S
sracherla
Hello Guys,
Please look at the code sample below.
Class Customer
{
private string _ID;
private string _Name;
public string ID
{
get { return _ID; }
set { _ID = value; }
}
public string Name
{
get { return _Name; }
set { _ID = Name; }
}
}
void SomeFunction(Customer, PropertyName as String)
{
does something
}
============
In UI (Design Time): A different application that using the above
assembly
psv main()
{
Customer myC = new Customer();
myC.ID = "1";
myC.Name = "John Doe";
SomeFunction(Customer, "ID");
// Instead of the above statement I want something like
SomeFunction(Customer, Customer.Properties.ID);
}
What are the strategies to make this possible?
I know of one using an inner class. It is outlined below. In class
customer add the following:
public class Properties
{
public const string ID = "ID";
public const string Name = "Name";
}
Thanks
Please look at the code sample below.
Class Customer
{
private string _ID;
private string _Name;
public string ID
{
get { return _ID; }
set { _ID = value; }
}
public string Name
{
get { return _Name; }
set { _ID = Name; }
}
}
void SomeFunction(Customer, PropertyName as String)
{
does something
}
============
In UI (Design Time): A different application that using the above
assembly
psv main()
{
Customer myC = new Customer();
myC.ID = "1";
myC.Name = "John Doe";
SomeFunction(Customer, "ID");
// Instead of the above statement I want something like
SomeFunction(Customer, Customer.Properties.ID);
}
What are the strategies to make this possible?
I know of one using an inner class. It is outlined below. In class
customer add the following:
public class Properties
{
public const string ID = "ID";
public const string Name = "Name";
}
Thanks