NDesk.Options : NDesk.Options Namespace

NDesk.Options

GIT Repository

OptionException Class

Represents the error that occurs when there is an error parsing an NDesk.Options.Option.

public class OptionException : Exception

Remarks

Instances of this class are thrown when:

Requirements

Namespace: NDesk.Options
Assembly: NDesk.Options (in NDesk.Options.dll)
Assembly Versions: 0.2.0.0, 0.2.1.0

Members

See Also: Inherited members from Exception.

Public Constructors

Creates and initializes a new instance of the NDesk.Options.OptionException class.
Creates and initializes a new instance of the NDesk.Options.OptionException class.

Protected Constructors

Public Properties

[read-only]
OptionName string . A string containing the option name that caused the exception.

Public Methods

Member Details

OptionException Constructor

Initializes a new instance of the NDesk.Options.OptionException class with serialized data.

See Also

OptionException.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)

Parameters

info
The System.Runtime.Serialization.SerializationInfo that holds the serialized object data about the exception being thrown.
context
The System.Runtime.Serialization.StreamingContext that contains contextual information about the source or destination.

Remarks

This constructor is called during deserialization to reconstitute the exception object transmitted over a stream, e.g. from Remoting.

Requirements

Namespace: NDesk.Options
Assembly: NDesk.Options (in NDesk.Options.dll)
Assembly Versions: 0.2.0.0, 0.2.1.0

OptionException Constructor

Creates and initializes a new instance of the NDesk.Options.OptionException class.

public OptionException (string message, string optionName)

Parameters

message
A string that describes the error.
optionName
A string that contains the name of the option that caused the exception.

Remarks

This constructor initializes the Exception.Message property of the new instance using message, and the OptionException.OptionName property of the new instance using optionName.

Requirements

Namespace: NDesk.Options
Assembly: NDesk.Options (in NDesk.Options.dll)
Assembly Versions: 0.2.0.0, 0.2.1.0

OptionException Constructor

Creates and initializes a new instance of the NDesk.Options.OptionException class.

public OptionException (string message, string optionName, Exception innerException)

Parameters

message
A string that describes the error.
optionName
A string that contains the name of the option that caused the exception.
innerException
An instance of Exception that is the cause of the current exception. If innerException is non-null, then the current Exception was raised in a catch block handling innerException.

Remarks

This constructor initializes the Exception.Message property of the new instance using message, the Exception.InnerException property of the new instance using innerException, and the OptionException.OptionName property of the new instance using optionName.

Requirements

Namespace: NDesk.Options
Assembly: NDesk.Options (in NDesk.Options.dll)
Assembly Versions: 0.2.0.0, 0.2.1.0

GetObjectData Method

Adds information about the exception to the provided System.Runtime.Serialization.SerializationInfo instance.

See Also

OptionException(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)

Parameters

info
The System.Runtime.Serialization.SerializationInfo that holds the serialized object data about the exception being thrown.
context
The System.Runtime.Serialization.StreamingContext that contains contextual information about the source or destination.

Remarks

Adds information about this exception instance to the provided System.Runtime.Serialization.SerializationInfo, so that a new cloned instance may be properly reconstituted later.

Requirements

Namespace: NDesk.Options
Assembly: NDesk.Options (in NDesk.Options.dll)
Assembly Versions: 0.2.0.0, 0.2.1.0

OptionName Property

A string containing the option name that caused the exception.

public string OptionName { get; }

Value

A string containing the option name that caused the exception.

Remarks

Requirements

Namespace: NDesk.Options
Assembly: NDesk.Options (in NDesk.Options.dll)
Assembly Versions: 0.2.0.0, 0.2.1.0