Solved

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

Posted on 2004-07-30
4
183 Views
Last Modified: 2010-04-15
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
Comment
Question by:dmullis
  • 2
  • 2
4 Comments
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 250 total points
ID: 11681521
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
 

Author Comment

by:dmullis
ID: 11694353
Hi Gregory,

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

Thanks.
0
 

Author Comment

by:dmullis
ID: 11738455
Thanks Gregory.
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11739918
anytime.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

838 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question