.net - C# - Alternative way to use attribute -


let got following :

public class {      [myattribute]      public void test() {} } 

i don't behavior of adding attribute prefix method or class []. think make code less readable.

i find better approach can :

addattribute(a, test, myattribute); 

is there way of doing ?

because kind of adding attribute @ runtime...

or there other way use attribute ? xml files ?

attributes cannot added @ runtime, embedded in metadata of assembly. can, however, add attributes using external tool during build modifies source code before compiling.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -