I can believe that the attribute may be a reference, since an attribute is a class, which is a reference type. What is happening in my case is that I have Indicators A and B, both derived from a common BaseClass. There is a BaseClass property with, naturally, the [Display ...] attribute. Both A and B update Display at runtime with the proper name and description for their specific indicator. The problem is that the last one wins. Looking at it in the debugger (Visual Studio) when B gets to do its work, the attribute is already showing the value A set its attribute to (i.e. not showing the default value it should be showing). B goes ahead and sets its name and description -- and these show up for both B and A in the GUI.
It sure looks to me as if the Display attribute is a reference. If so, I need to break that so each indicator has its own values. Any help will be appreciated.
--EV
P.S. the problem I am trying to solve is that the [Display] name and description for this base class property cannot be known at compile time, since they depend on the derived class. Hence the attempt to set them at run time. I just need to solve the problem -- handling a reference is academic if there is a better way to solve the problem. I'd still like to understand about the reference issue, but the #1 thing is just to solve the problem.
Comment