namespace.object.method.attribute
For insatance if i'm "using System;" namespace its then object.method, the question is to use attributes is it then object.method.attribute?
Ya, <-- n00b so thx for any help hehe :)
Printable View
namespace.object.method.attribute
For insatance if i'm "using System;" namespace its then object.method, the question is to use attributes is it then object.method.attribute?
Ya, <-- n00b so thx for any help hehe :)
What do you mean by attritube? Do you mean an attribute to the class? Is so it is object.attribute. What material are you using to learn?
If you mean the attribute with which the method is annotated (e.g. [OperationContract]), then you have to use reflection to obtain it. Like this:
Code:Type t = Type.GetType("namespace.object"); // assume by object you mean class
MethodInfo mi = t.GetMethod("YourMethodName");
object[] attrs = mi.GetCustomAttributes(false);
// and now, you can iterate over attrs and investigate them