FileFormatException Constructors

Definition

Overloads

FileFormatException()

Creates a new instance of the FileFormatException class.

FileFormatException(String)

Creates a new instance of the FileFormatException class with a specified error message.

FileFormatException(Uri)

Creates a new instance of the FileFormatException class with a source URI value.

FileFormatException(SerializationInfo, StreamingContext)

Creates a new instance of the FileFormatException class and initializes it with serialized data. This constructor is called during deserialization to reconstitute the exception object transmitted over a stream.

FileFormatException(String, Exception)

Creates a new instance of the FileFormatException class with a specified error message and exception type.

FileFormatException(Uri, Exception)

Creates a new instance of the FileFormatException class with a source URI value and an exception type.

FileFormatException(Uri, String)

Creates a new instance of the FileFormatException class with a source URI value and a specified error message.

FileFormatException(Uri, String, Exception)

Creates a new instance of the FileFormatException class with a source URI value, a specified error message, and an exception type.

FileFormatException()

Creates a new instance of the FileFormatException class.

public FileFormatException ();

Remarks

This constructor uses a default system message that describes the error, such as "An input file or a data stream does not conform to the expected file format specification." This message takes into account the current system culture.

FileFormatException(String)

Creates a new instance of the FileFormatException class with a specified error message.

public FileFormatException (string message);
Parameters
message
String

A String value that represents the error message.

FileFormatException(Uri)

Creates a new instance of the FileFormatException class with a source URI value.

public FileFormatException (Uri sourceUri);
Parameters
sourceUri
Uri

The Uri value of the file that caused this error.

Remarks

This constructor initializes the Message property of the new FileFormatException instance to a system-supplied message that describes the error and includes the file name, such as "The file 'sourceUri' does not conform to the expected file format specification." This message takes into account the current system culture.

The SourceUri property is initialized using the sourceUri parameter.

FileFormatException(SerializationInfo, StreamingContext)

Creates a new instance of the FileFormatException class and initializes it with serialized data. This constructor is called during deserialization to reconstitute the exception object transmitted over a stream.

protected FileFormatException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
Parameters
info
SerializationInfo

The object that holds the serialized object data.

context
StreamingContext

The contextual information about the source or destination.

FileFormatException(String, Exception)

Creates a new instance of the FileFormatException class with a specified error message and exception type.

public FileFormatException (string message, Exception innerException);
Parameters
message
String

A String value that represents the error message.

innerException
Exception

The value of the InnerException property, which represents the cause of the current exception.

Remarks

This constructor initializes the Message property of the new FileFormatException instance with the specified error message represented by message.

FileFormatException(Uri, Exception)

Creates a new instance of the FileFormatException class with a source URI value and an exception type.

public FileFormatException (Uri sourceUri, Exception innerException);
Parameters
sourceUri
Uri

The Uri value of the file that caused this error.

innerException
Exception

The value of the InnerException property, which represents the cause of the current exception.

Remarks

This constructor initializes the Message property of the new instance to a system-supplied message that describes the error and includes the file name, such as "The file 'sourceUri' does not conform to the expected file format specification." This message takes into account the current system culture.

The SourceUri property is initialized using the sourceUri parameter.

FileFormatException(Uri, String)

Creates a new instance of the FileFormatException class with a source URI value and a specified error message.

public FileFormatException (Uri sourceUri, string message);
Parameters
sourceUri
Uri

The Uri value of the file that caused this error.

message
String

A String value that represents the error message.

Remarks

This constructor initializes the Message property of the new FileFormatException instance with the specified error message represented by message. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

The SourceUri property is initialized using the sourceUri parameter.

FileFormatException(Uri, String, Exception)

Creates a new instance of the FileFormatException class with a source URI value, a specified error message, and an exception type.

public FileFormatException (Uri sourceUri, string message, Exception innerException);
Parameters
sourceUri
Uri

The Uri value of the file that caused this error.

message
String

A String value that represents the error message.

innerException
Exception

The value of the InnerException property, which represents the cause of the current exception.

Remarks

This constructor initializes the Message property of the new instance using the message parameter. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

The SourceUri property is initialized using the sourceUri parameter.

Applies to