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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -