T
tshad
Is there a way to set up arrays of list collections?
For example, if I have a class such as:
*********************************
public class ParseItem
{
public enum ParseItemTypes
{
DirectionType,
StreetType,
ApartmentType
}
string mstrTestValue;
string mstrReplaceValue;
ParseItemTypes meType;
public ParseItemTypes ParseType
{
get { return meType; }
set { meType = value; }
}
public string ValueTest
{
get { return mstrTestValue; }
set { mstrTestValue = value; }
}
public new string ToString()
{
return ParseType + " / " + ValueReplace;
}
}
*********************************
I would normally set up my list as:
List<ParseItem> mcolParseItems = new List<ParseItem>();
The problem is that I really need to separate these into 3 lists (one for
each of the enums in the class). This is because the lists are so large it
will take a lot of time each time I do a search on the list. I want to be
able to do ".Find" on only DirectionTypes or StreetTypes.
I thought about setting up 3 different lists but then figured that if I
added another item to the enum, it would be nice to have the program set up
the list automatically based on the enum count. If there are 3 enums items,
it would set an array of 3 lists. If there are 5 enums, it would set up an
array of 5 lists.
I would then access the arrays by enum name.
Can this be done?
Thanks,
Tom
For example, if I have a class such as:
*********************************
public class ParseItem
{
public enum ParseItemTypes
{
DirectionType,
StreetType,
ApartmentType
}
string mstrTestValue;
string mstrReplaceValue;
ParseItemTypes meType;
public ParseItemTypes ParseType
{
get { return meType; }
set { meType = value; }
}
public string ValueTest
{
get { return mstrTestValue; }
set { mstrTestValue = value; }
}
public new string ToString()
{
return ParseType + " / " + ValueReplace;
}
}
*********************************
I would normally set up my list as:
List<ParseItem> mcolParseItems = new List<ParseItem>();
The problem is that I really need to separate these into 3 lists (one for
each of the enums in the class). This is because the lists are so large it
will take a lot of time each time I do a search on the list. I want to be
able to do ".Find" on only DirectionTypes or StreetTypes.
I thought about setting up 3 different lists but then figured that if I
added another item to the enum, it would be nice to have the program set up
the list automatically based on the enum count. If there are 3 enums items,
it would set an array of 3 lists. If there are 5 enums, it would set up an
array of 5 lists.
I would then access the arrays by enum name.
Can this be done?
Thanks,
Tom