mscorlib(4.0.0.0) API with additions
ObsoleteAttribute.cs
2 
3 namespace System
4 {
7  [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
8  [ComVisible(true)]
9  [__DynamicallyInvokable]
10  public sealed class ObsoleteAttribute : Attribute
11  {
12  private string _message;
13 
14  private bool _error;
15 
18  [__DynamicallyInvokable]
19  public string Message
20  {
21  [__DynamicallyInvokable]
22  get
23  {
24  return _message;
25  }
26  }
27 
31  [__DynamicallyInvokable]
32  public bool IsError
33  {
34  [__DynamicallyInvokable]
35  get
36  {
37  return _error;
38  }
39  }
40 
42  [__DynamicallyInvokable]
44  {
45  _message = null;
46  _error = false;
47  }
48 
51  [__DynamicallyInvokable]
52  public ObsoleteAttribute(string message)
53  {
54  _message = message;
55  _error = false;
56  }
57 
62  [__DynamicallyInvokable]
63  public ObsoleteAttribute(string message, bool error)
64  {
65  _message = message;
66  _error = error;
67  }
68  }
69 }
Marks the program elements that are no longer in use. This class cannot be inherited.
string Message
Gets the workaround message, including a description of the alternative program elements.
Represents the base class for custom attributes.
Definition: Attribute.cs:15
Definition: __Canon.cs:3
ObsoleteAttribute(string message, bool error)
Initializes a new instance of the T:System.ObsoleteAttribute class with a workaround message and a Bo...
ObsoleteAttribute(string message)
Initializes a new instance of the T:System.ObsoleteAttribute class with a specified workaround messag...
ObsoleteAttribute()
Initializes a new instance of the T:System.ObsoleteAttribute class with default properties.
AttributeTargets
Specifies the application elements on which it is valid to apply an attribute.
bool IsError
Gets a Boolean value indicating whether the compiler will treat usage of the obsolete program element...
Specifies that the class can be serialized.