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 deprecated
to 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
Post a Comment