¡@

Home 

c# Programming Glossary: mycustomattribute

How do I get the member to which my custom attribute was applied?

http://stackoverflow.com/questions/2168942/how-do-i-get-the-member-to-which-my-custom-attribute-was-applied

AttributeTargets.Property AllowMultiple true public class MyCustomAttribute Attribute Update okay I might have been asking the wrong question...

Can I initialize a C# attribute with an array or other variable number of arguments

http://stackoverflow.com/questions/270187/can-i-initialize-a-c-sharp-attribute-with-an-array-or-other-variable-number-of-a

with a variable number of arguments For example MyCustomAttribute new int 3 4 5 this doesn't work public MyClass ... c# attributes.. use params instead which is nicer to consumers IMO class MyCustomAttribute Attribute public int Values get set public MyCustomAttribute.. Attribute public int Values get set public MyCustomAttribute params int values this.Values values MyCustomAttribute 3 4 5..

c# - How do you get a variable's name as it was physically typed in its declaration? [duplicate]

http://stackoverflow.com/questions/716399/c-sharp-how-do-you-get-a-variables-name-as-it-was-physically-typed-in-its-dec

world situation there is a custom attribute above city. MyCustomAttribute param1 param2 etc public string city New York I need this attribute.. And in the reflection code I need to type the string city MyCustomAttribute attr Type t typeof Person foreach FieldInfo field in t.GetFields..