c# - Change values in Class Attribute at runtime -


if have class this

[attr("blah",  data = "blah")] public class test : superclass{} 

is there way can change values of attribute of instance of class @ runtime? eg in pseudo code

superclass test = new test(); test.attr.value = "blah1"; test.attr.data = "blah2"; 

(i have instance of class want change attributes on, cast class extends)

there no implicit connection between attributes , objects instances. between class , attribute. best bet attribute in constructor , "cache" values in properties on object. of course doesn't make sense if looking @ test class, make sense if constructor of superclass looks custom attributes on type retrieved "this.gettype()".


Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -