Represents the error that occurs when there is an error parsing an NDesk.Options.Option.
Instances of this class are thrown when:
- There is an exception generated converting a string to an object of type T within the callback registered by OptionSet.Add``1(string, string, Action<``0>) (and related overloads).
- Option.Parse``1(string, OptionContext) could not convert a string to an object of type T.
- An option with a Option.OptionValueType value of OptionValueType.Required does not have a value (usually because the start of the option was the last argument).
Namespace: NDesk.Options
Assembly: NDesk.Options (in NDesk.Options.dll)
Assembly Versions: 0.2.0.0, 0.2.1.0
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
Initializes a new instance of the NDesk.Options.OptionException class with serialized data. ⊟ Public Properties
[read-only] OptionName string . A string containing the option name that caused the exception. ⊟ Public Methods
overrideGetObjectData (System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext) Adds information about the exception to the provided System.Runtime.Serialization.SerializationInfo instance.
⊟ OptionException Constructor
Initializes a new instance of the NDesk.Options.OptionException class with serialized data.
protected OptionException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)⊟ 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.⊟ 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.
⊟ Parameters
⊟ 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.
⊟ 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.
public override void GetObjectData (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)⊟ 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.⊟ 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