Click to See Complete Forum and Search --> : Getting Class property value


nesamani
February 14th, 2008, 06:06 AM
hi..
class Class1
{
private int id;
private string name;
private string address;
private string degree;
private string dept;
private bool val;
public StudentMark sm = new StudentMark();


[CategoryAttribute("General")]
public int ID
{
set { id = value; }
get { return id; }
}

[CategoryAttribute("General")]

public string Name
{
set { name = value; }
get { return name; }
}

[CategoryAttribute("General1")]
public string Address
{
set { address = value; }
get { return address; }
}


[CategoryAttribute("Education")]
public string Degree
{
set { degree = value; }
get { return degree; }
}

[CategoryAttribute("Education")]
public string Dept
{
set { dept = value; }
get { return dept; }
}
[CategoryAttribute("Education")]
public bool Val
{
set { val = value; }
get { return val; }
}


[CategoryAttribute("General")]
[TypeConverter(typeof(Ex))]
public StudentMark St
{
get { return sm; }
}
}
i created class like this..i can get the properties value using reflection..
but not able get this property value
[CategoryAttribute("General")]
[TypeConverter(typeof(Ex))]
public StudentMark St
{
get { return sm; }
}

wildfrog
February 14th, 2008, 05:43 PM
Please use code-tags when posting code.

i created class like this..i can get the properties value using reflection..
but not able get this property valueIt shouldn't be any different from the other properties. What does your code look like?

- petter

boudino
February 15th, 2008, 03:23 AM
Do you think get it in code, or get in designer's property browser? Than you have to take care about the TypeConverter attribute.