Show / Hide Table of Contents

    Class ObsoleteAttribute

    Marks the program elements that are no longer in use. This class cannot be inherited.

    Inheritance
    Object
    Attribute
    ObsoleteAttribute
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: System
    Assembly: mscorlib.dll
    Syntax
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
    public sealed class ObsoleteAttribute : Attribute

    Constructors

    | Improve this Doc View Source

    ObsoleteAttribute()

    Initializes a new instance of the ObsoleteAttribute class with default properties.

    Declaration
    public ObsoleteAttribute()
    | Improve this Doc View Source

    ObsoleteAttribute(String)

    Initializes a new instance of the ObsoleteAttribute class with a specified workaround message.

    Declaration
    public ObsoleteAttribute(string message)
    Parameters
    Type Name Description
    String message

    The text string that describes alternative workarounds.

    | Improve this Doc View Source

    ObsoleteAttribute(String, Boolean)

    Initializes a new instance of the ObsoleteAttribute class with a workaround message and a Boolean value indicating whether the obsolete element usage is considered an error.

    Declaration
    public ObsoleteAttribute(string message, bool error)
    Parameters
    Type Name Description
    String message

    The text string that describes alternative workarounds.

    Boolean error

    true if the obsolete element usage generates a compiler error; false if it generates a compiler warning.

    Properties

    | Improve this Doc View Source

    IsError

    Gets a Boolean value indicating whether the compiler will treat usage of the obsolete program element as an error.

    Declaration
    public bool IsError { get; }
    Property Value
    Type Description
    Boolean

    true if the obsolete element usage is considered an error; otherwise, false. The default is false.

    | Improve this Doc View Source

    Message

    Gets the workaround message, including a description of the alternative program elements.

    Declaration
    public string Message { get; }
    Property Value
    Type Description
    String

    The workaround text string.

    Extension Methods

    LogDispatcher.GetCurrentClassLogger(Object)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2018 nanoFramework Contributors
    Generated by DocFX