Hello,
I need add new method to my properties. these methods should give me
some attributes coming from my database.
I think, to create a class with implement PropertyInfo but I don't know
how To call my custom class.
My code like this :
public abstract class Class2 : PropertyInfo //, RuntimePropertyInfo
{
public override System.Reflection.PropertyAttributes Attributes
{
get { throw new Exception("The method or operation is not
implemented."); }
}
public override bool CanRead
{
get { throw new Exception("The method or operation is not
implemented."); }
}
public override bool CanWrite
{
get { throw new Exception("The method or operation is not
implemented."); }
}
public override MethodInfo[] GetAccessors(bool nonPublic)
{
throw new Exception("The method or operation is not
implemented.");
}
public override MethodInfo GetGetMethod(bool nonPublic)
{
throw new Exception("The method or operation is not
implemented.");
}
public override ParameterInfo[] GetIndexParameters()
{
throw new Exception("The method or operation is not
implemented.");
}
public override MethodInfo GetSetMethod(bool nonPublic)
{
throw new Exception("The method or operation is not
implemented.");
}
public override object GetValue(object obj, BindingFlags
invokeAttr, Binder binder, object[] index,
System.Globalization.CultureInfo culture)
{
throw new Exception("The method or operation is not
implemented.");
}
public override Type PropertyType
{
get { throw new Exception("The method or operation is not
implemented."); }
}
public override void SetValue(object obj, object value,
BindingFlags invokeAttr, Binder binder, object[] index,
System.Globalization.CultureInfo culture)
{
throw new Exception("The method or operation is not
implemented.");
}
public override Type DeclaringType
{
get { throw new Exception("The method or operation is not
implemented."); }
}
public override object[] GetCustomAttributes(Type attributeType,
bool inherit)
{
throw new Exception("The method or operation is not
implemented.");
}
public override object[] GetCustomAttributes(bool inherit)
{
throw new Exception("The method or operation is not
implemented.");
}
public override bool IsDefined(Type attributeType, bool inherit)
{
throw new Exception("The method or operation is not
implemented.");
}
public override string Name
{
get { throw new Exception("The method or operation is not
implemented."); }
}
public override Type ReflectedType
{
get { throw new Exception("The method or operation is not
implemented."); }
}
private bool myEnable;
public bool getEnable()
{
return myEnable;
}
public void setEnable(bool enable_)
{
myEnable= enable_;
}
}
And, I would take a property from another class and check the boolean
enable with the get and set ...
Any Idea...
Thanks