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:

Members

See Also: Inherited members from Exception.

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

Properties

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

Methods

Member Details

OptionException Constructor

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

See Also

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.

Version Information:

  • NDesk.Options 0.2.0.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.

Version Information:

  • NDesk.Options 0.2.0.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.

Version Information:

  • NDesk.Options 0.2.0.0

GetObjectData Method

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

See Also

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.

Version Information:

  • NDesk.Options 0.2.0.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

Version Information:

  • NDesk.Options 0.2.0.0