c# - How to restrict given method/class use in current code -


in c#, [obsolete] can used 'code author' mark code obsolete.

however, there method 'code user' mark method/class restricted in his/her code?

in c++ (visual c++), have #pragma deprecatedto archive purpose, more or less. there counterpart in c#?

for example,

.net provides marshal.sizeof() method in system.runtime.interopservices.marshal class. not want use marshal.sizeof() in code, need other methods in marshal class. how can apply policy in code other check code eyes... (use proxy class/etc. heavy purpose.)

in visual c++, #pragma deprecated has limited function purpose.

i'm not sure asking, trying compiler issue error if deprecated method used?

if use [obsolete(string, bool)] version (msdn documentation) , set bool parameter true , compiler issue error usages of method


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -