Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 948645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:16:32+00:00 2026-05-15T23:16:32+00:00

The following is my custom class, with collections. My application is an MDI app

  • 0

The following is my custom class, with collections. My application is an MDI app with the ability to open a “Program” form multiple times for multiple programs and I want to use the ProgramBudget class but I want all of the “subclasses” within the Program budget to be contained within the Program form ProgramBudget class.

I am having issues however where the subclasses keep getting referenced in IntelliSense recursivelly (i.e.: ProgramBudget.ParticipantTypeBudget.ParticipantTypeBudget.ParticipantTypeBudget…)

What is wrong with this class and how do i work with it, the custom class is below:

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IPAM_NSF_Financials.Application_Classes
{
    public class ProgramBudget
    {
        internal string strProgramCode;
        private string strActualTravelSourceRefCode;
        private string strActualExpenseSourceRefCode;
        private string strProgramBudgetComment;
        private string strParticipantComment;
        private decimal decInitTravel;
        private decimal decInitLodging;
        private decimal decInitStipend;
        private decimal decRemTravel;
        private decimal decRemLodging;
        private decimal decRemStipend;
        private decimal decPartTypeTravel;
        private decimal decPartTypeExpenses;
        private decimal decPartPrimTravelBudget;
        private decimal decPartPrimExpenseBudget;
        private decimal decPartPrimRegFee;
        private decimal decActualTravelAir;
        private decimal decActualTravelGround;
        private decimal decActualTravelMisc;
        private decimal decActualExpenseLodging;
        private decimal decActualExpenseCatering;
        private decimal decActualExpenseMisc;
        private int nProgramBudgetID;
        private int nParticipantTypeBudgetID;
        private int nParticipantBudgetHDRID;
        private int nParticipantBudgetHDRCommentID;
        private int nParticipantBudgetDTLID;
        private int nParticipantBudgetDTLExpenseID;
        private int nParticipantBudgetDTLTravelID;
        private int nPartType;
        private int nParticipant;
        private int nActualTravelSource;
        private int nActualExpenseSource;

        public int ProgramBudgetID
        {
            get { return nProgramBudgetID; }
            set { nProgramBudgetID = value; }
        }

        public string ProgramCode
        {
            get { return strProgramCode; }
            set { strProgramCode = value; }
        }

        public decimal InitialTravel
        {
            get { return decInitTravel; }
            set { decInitTravel = value; }
        }

        public decimal InitialLodging
        {
            get { return decInitLodging; }
            set { decInitLodging = value; }
        }

        public decimal InitialStipend
        {
            get { return decInitStipend; }
            set { decInitStipend = value; }
        }

        public decimal RemainingTravel
        {
            get { return decRemTravel; }
            set { decRemTravel = value; }
        }

        public decimal RemainingLodging
        {
            get { return decRemLodging; }
            set { decRemLodging = value; }
        }

        public decimal RemainingStipend
        {
            get { return decRemStipend; }
            set { decRemStipend = value; }
        }

        public string ProgramBudgetComment
        {
            get { return strProgramBudgetComment; }
            set { strProgramBudgetComment = value; }
        }

        public class ParticipantTypeBudget : ProgramBudget
        {
            public int ParticipantTypeBudgetID
            {
                get { return nParticipantTypeBudgetID; }
                set { nParticipantTypeBudgetID = value; }
            }

            public int ParticipantType
            {
                get { return nPartType; }
                set { nPartType = value; }
            }

            public decimal ParticipantTypeTravel
            {
                get { return decPartTypeTravel; }
                set { decPartTypeTravel = value; }
            }

            public decimal ParticipantTypeExpenses
            {
                get { return decPartTypeExpenses; }
                set { decPartTypeExpenses = value; }
            }
        }

        class ParticipantTypeBudgets : CollectionBase
        {
            public void Add(ParticipantTypeBudget partTypeBudgetObject)
            { InnerList.Add(partTypeBudgetObject); }

            public void Remove(int Index)
            { InnerList.RemoveAt(Index); }

            public ParticipantTypeBudget Item(int Index)
            { return (ParticipantTypeBudget)InnerList[Index]; }
        }

        public class ParticipantPrimaryBudget : ProgramBudget
        {
            public int ParticipantBudgetHDRID
            {
                get { return nParticipantBudgetHDRID; }
                set { nParticipantBudgetHDRID = value; }
            }

            public int ParticipantID
            {
                get { return nParticipant; }
                set { nParticipant = value; }
            }

            public string ParticipantBudgetComment
            {
                get { return strParticipantComment; }
                set { strParticipantComment = value; }
            }

            public decimal ParticipantPrimaryTravelBudget
            {
                get { return decPartPrimTravelBudget; }
                set { decPartPrimTravelBudget = value; }
            }

            public decimal ParticipantPrimaryExpenseBudget
            {
                get { return decPartPrimExpenseBudget; }
                set { decPartPrimExpenseBudget = value; }
            }

            public decimal ParticipantPrimaryRegFee
            {
                get { return decPartPrimRegFee; }
                set { decPartPrimRegFee = value; }
            }
        }

        public class ParticipantActualTravelBudget : ProgramBudget
        {
            public int ParticipantBudgetDTLID
            {
                get { return nParticipantBudgetDTLID; }
                set { nParticipantBudgetDTLID = value; }
            }

            public int ParticipantBudgetDTLTravelID
            {
                get { return nParticipantBudgetDTLTravelID; }
                set { nParticipantBudgetDTLTravelID = value; }
            }

            public int FundingSource
            {
                get { return nActualTravelSource; }
                set { nActualTravelSource = value; }
            }

            public string ReferenceCode
            {
                get { return strActualTravelSourceRefCode; }
                set { strActualTravelSourceRefCode = value; }
            }

            public decimal Air
            {
                get { return decActualTravelAir; }
                set { decActualTravelAir = value; }
            }

            public decimal Ground
            {
                get { return decActualTravelGround; }
                set { decActualTravelGround = value; }
            }

            public decimal Miscellaneous
            {
                get { return decActualTravelMisc; }
                set { decActualTravelMisc = value; }
            }
        }

        class ParticipantActualTravelBudgets : CollectionBase
        {
            public void Add(ParticipantActualTravelBudget partActTravelBudgetObject)
            { InnerList.Add(partActTravelBudgetObject); }

            public void RemoveAt(int Index)
            { InnerList.RemoveAt(Index); }

            public ParticipantActualTravelBudget Item(int Index)
            { return (ParticipantActualTravelBudget)InnerList[Index]; }
        }

        public class ParticipantActualExpensesBudget : ProgramBudget
        {
            public int ParticipantBudgetDTLID
            {
                get { return nParticipantBudgetDTLID; }
                set { nParticipantBudgetDTLID = value; }
            }

            public int ParticipantBudgetDTLExpenseID
            {
                get { return nParticipantBudgetDTLExpenseID; }
                set { nParticipantBudgetDTLExpenseID = value; }
            }

            public int FundingSource
            {
                get { return nActualExpenseSource; }
                set { nActualExpenseSource = value; }
            }

            public string ReferenceCode
            {
                get { return strActualExpenseSourceRefCode; }
                set { strActualExpenseSourceRefCode = value; }
            }

            public decimal Lodging
            {
                get { return decActualExpenseLodging; }
                set { decActualExpenseLodging = value; }
            }

            public decimal Catering
            {
                get { return decActualExpenseCatering; }
                set { decActualExpenseCatering = value; }
            }

            public decimal Miscellaneous
            {
                get { return decActualExpenseMisc; }
                set { decActualExpenseMisc = value; }
            }
        }

        class ParticipantActualExpenseBudgets : CollectionBase
        {
            public void Add(ParticipantActualExpensesBudget partActExpensesBudgetObject)
            { InnerList.Add(partActExpensesBudgetObject); }

            public void RemoveAt(int Index)
            { InnerList.RemoveAt(Index); }

            public ParticipantActualExpensesBudget Item(int Index)
            { return (ParticipantActualExpensesBudget)InnerList[Index]; }
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:16:33+00:00Added an answer on May 15, 2026 at 11:16 pm

    ParticipantTypeBudget is a member of ProgramBudget. ParticipantTypeBudget also inherits ProgramBudget, which means it gets all of ProgramBudget‘s non-private members.

    See the problem?

    class Foo {
        class Bar : Foo {
    
        }
    }
    
    //perfectly legal:
    Foo.Bar.Bar.Bar.Bar.Bar = new Foo.Bar.Bar.Bar.Bar.Bar.Bar.Bar.Bar.Bar.Bar.Bar.Bar();
    

    To get rid of this recursion, move ParticipantTypeBudget, etc out of ProgramBudget.

    EDIT: Also, you asked about auto properties. Those are properties that don’t have explicit backing fields. I use two patterns:

    For a read/write property, you do this:

    public int MyProperty {
        get;
        set;
    }
    

    Note that both get and set must not have a body.

    If you need a read-only property, i.e. one that can only be set by the object itself, make the set member protected:

    public int MyProperty {
        get;
        protected set;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got the following custom widget: class QDESIGNER_WIDGET_EXPORT MySpecialButton : public QAbstractButton { Q_OBJECT
The following is the custom class, whose object I am trying to pass: package
I have the following methods in my simple Custom Parser Class, when I execute
I have a model class that uses a custom validator as shown in following
I've got following method in a class, which is a custom adapter for an
I have the following custom event: package com.un.photoManager.events { import flash.events.Event; import mx.collections.ArrayCollection; public
How Many Times Does an ASP .NET Application Start? I want to run something
I'm writing an MVC2 app using DataAnnotations. I have a following Model: public class
I want to make a custom control in my website. Following is the Code:
So I am utilizing CollectionBase as an inherited class for custom collections. I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.