mardi 16 juin 2015

How to read property attribute in the defining type class?

Let's say I have a property defined like below:

[SomeAttriubte("#1")]
public SomeClass Property1 { get; set; }

[SomeAttribute("#2")]
public SomeClass Property2 { get; set; }

Which SomeClass definition is something like this:

public class SomeClass
{
     private void PrivateMethod()
     {
           //Some action
     }
}

Is there any way to read SomeAttribute argument value in the PrivateMethod inside the defining type class??





Aucun commentaire:

Enregistrer un commentaire