[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 190
  • Last Modified:

Combine 2 members of a class and re-define as one

Hi, I am very new to programming in general so I hope my terms are correct enough for someone to understand.

I have a cs page with the following public class and 2 members defined in the class:

//section I am refering to--------------------------------------------------

public class AccidentViolationContainer : Table
      {
            public ViolationList ViolationList = new ViolationList();
            public AccidentList AccidentList = new AccidentList();
       
//End of section I am refering to---------------------------------------------------

            public AccidentViolationContainer()
            {
                  for (int i = 0; i <= 10; i++)
                  {

                                                                .. so , and so..
               
I need to combine "public ViolationList ViolationList = new ViolationList();" and "public AccidentList AccidentList = new AccidentList();" here :

public class AccidentViolationContainer : Table
      {
            public ViolationList ViolationList = new ViolationList();
            public AccidentList AccidentList = new AccidentList();

...and call it something new. How do I do that?
0
dmullis
Asked:
dmullis
  • 2
  • 2
1 Solution
 
gregoryyoungCommented:
from looking at it ...

            public ArrayList AccidentAndViolationList
            {
                  get
                  {
                        ArrayList ret = new ArrayList();
                        ret.AddRange(AccidentList);
                        ret.AddRange(ViolationList);
                        }
            }

will build an untyped list from the two lists ...
0
 
dmullisAuthor Commented:
Hi Gregory,

 I am going to investigate this possible solution, give it a try and get back to the boards.

Thanks.
0
 
dmullisAuthor Commented:
Thanks Gregory.
0
 
gregoryyoungCommented:
anytime.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now