I was looking for properties using get/set. And how to assign the
list via the constructor?
Example:
//trying to create a list that's a property of a class holding IP
addresses of a computer
private List<string> lIPAddressList;
internal List<string> IPAddressList {
get { return lIPAddressList; }
set { lIPAddressList = value; }
}
//The constructor of the class
internal CustomException( ) {
this.sUserName = Environment.UserName;
this.sDomainName = Environment.UserDomainName;
this.sComputerName = Dns.GetHostName();
// what to assign the whole list to a property
//this.lIPAddress =
Dns.GetHostEntry(ComputerName).AddressList; //what to put here?
}
It's just a lit of strings. Could be an array or List<string> or
whatever, just need to assign to a collection.