dimanche 12 juillet 2020

Change method's attribute parameter at runtime?

    public sealed class MyAtt : Attribute
    {
        private string _name;
        public MyAtt(string name)
        {
            _name = name;
        }
    }
    public class MyClass
    {
        [MyAtt("hope_to_changed")]
        public void Execute() { }
    }

I wan't get two instances of MyClass,one has a method with attribute named "one". the another with attribute named "two".

How can i change method's attribute parameter at runtime?





Aucun commentaire:

Enregistrer un commentaire