H
Hoop
Hi,
I have a class that uses a number of lists for data storing.
Up to this point in testing they have been public, an example of one
of them,
public List<string> circuitNameList = new List<string>();
I want to make them private and acess them via properties. Looking
into this I have found that for this type
of data one has to use an indexer, so I did make one,
public string this [int index]
{
get
{
return circuitNameList[index - 1].ToString();
}
set
{
circuitNameList.Add(value);
}
}
Using the above I see no way to know which list I am writing too or
reading from.
I must be missing something here.
What is the correct way for using preoperties to access data
collections?
Thanks for any help
Jeff
I have a class that uses a number of lists for data storing.
Up to this point in testing they have been public, an example of one
of them,
public List<string> circuitNameList = new List<string>();
I want to make them private and acess them via properties. Looking
into this I have found that for this type
of data one has to use an indexer, so I did make one,
public string this [int index]
{
get
{
return circuitNameList[index - 1].ToString();
}
set
{
circuitNameList.Add(value);
}
}
Using the above I see no way to know which list I am writing too or
reading from.
I must be missing something here.
What is the correct way for using preoperties to access data
collections?
Thanks for any help
Jeff