473,388 Members | 1,557 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

URGENT ! implement PropertyInfo

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

May 2 '06 #1
0 1401

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tony Tullemans | last post by:
I am trying to write a subroutine that will examine all the properties of a form to determine which of those are SqlCommand objects, and then set the Connection property of those SqlCommands to a...
1
by: David | last post by:
Basically, my class has a reference type as one of its property. For example - Employee class has a perperty called Name - Name is a class with string properties - FirstName, LastName,...
2
by: Picho | last post by:
Hi guys is it possible, once getting hold of a propertyInfo instance to know when the value of the property changed? that is without requiring the property to raise an event on change...
15
by: Charles Law | last post by:
I have adapted the following code from the MSDN help for PropertyInfo SetValue. In the original code, the structure MyStructure is defined as a class MyProperty, and it works as expected. There is...
0
by: SyZLaB | last post by:
I had a problem using system.reflection.propertyinfo.getvalue in vb - and searched a lots of newsgroups and libraries - but none had the solution to my problem - and it also seamed like many others...
3
by: ricolee99 | last post by:
Hi everyone, I have a problem that i have been trying to solve for awhile. I'm given a code where the purpose is to create a general dataset mapper. Given any dataset, i have a class,...
2
by: Carlos Rodriguez | last post by:
I have the following function in C#public void Undo(IDesignerHost host) { if (!this.componentName.Equals(string.Empty) && (this.member != null)) { IContainer container1 = (IContainer)...
5
by: koonda | last post by:
Hi all, I am a student and I have a project due 20th of this month, I mean May 20, 2007 after 8 days. The project is about creating a Connect Four Game. I have found some code examples on the...
9
by: FourEyes | last post by:
I've read that Reflection is slow and shouldn't be used when performance is a concern. In my case, performance is definitely a concern, so I was thinking that I could collect the PropertyInfo...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.