HypernovaDesktop Components · docs
Binarymission
WPF › Skinning › BinarySkinFormatException

BinarySkinFormatException

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WPF.Skinning

The exception thrown for a skin file that is not JSON, or is JSON that does not describe a skin. The message names the line and column of the mistake.

public class BinarySkinFormatException : FormatException

Inherits from / implements: FormatException

Remarks

BinarySkinSerializer throws it with a message written for the person editing the file, such as Line 6, column 15: "#12345" is not a colour. Write it #RRGGBB or #AARRGGBB., so it can be shown to them as it is.

Examples

try
{
    BinarySkinManager.Apply(BinarySkinSerializer.Load(path));
}
catch (BinarySkinFormatException ex)
{
    MessageBox.Show(ex.Message, "This skin file cannot be used");
}

Members at a glance

Constructors
BinarySkinFormatExceptionCreates the exception with the default message and no position.
BinarySkinFormatExceptionCreates the exception with a message and no position.
BinarySkinFormatExceptionCreates the exception with a message and the error that caused it.
BinarySkinFormatExceptionCreates the exception with a message and the place in the file it is about. The message is prefixed with "Line line, column column: ".
Properties
ColumnGets the column of the mistake.
LineGets the line of the mistake.

Constructors

BinarySkinFormatException

public BinarySkinFormatException()

Creates the exception with the default message and no position.

BinarySkinFormatException

public BinarySkinFormatException(string message) : base(message)

Creates the exception with a message and no position.

Parameters
message
What is wrong.

BinarySkinFormatException

public BinarySkinFormatException(string message, Exception innerException) : base(message, innerException)

Creates the exception with a message and the error that caused it.

Parameters
message
What is wrong.
innerException
The error that caused it.

BinarySkinFormatException

public BinarySkinFormatException(string message, int line, int column) : base(string.Format(CultureInfo.InvariantCulture, "Line

Creates the exception with a message and the place in the file it is about. The message is prefixed with "Line line, column column: ".

Parameters
message
What is wrong.
line
The line, counted from 1.
column
The column, counted from 1.

Properties

Column

public int Column

Gets the column of the mistake.

Value
Counted from 1; 0 when the message is not about one place.

Line

public int Line

Gets the line of the mistake.

Value
Counted from 1; 0 when the message is not about one place.