Change from const to property and static context (C#) -


i had public class that:

public class classn {     public const int someint = 16;     ... } 

this called somewhere else using

int myint = classn.someint 

now have change 16 more dynamic , looks this:

public int someint {         {          //this method not static , cant changed static           return getintdynamically();         } } 

of course call not working anymore, because of static context. cant create new instance of classn ... option not violate coding rules?

thanks

if getintdynamically not static , can't made static, have no other option create instance of classn.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -