Spaces:
Sleeping
Sleeping
File size: 1,753 Bytes
fc9bc1a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | using System;
namespace UnityMeshSimplifier
{
/// <summary>
/// An exception thrown when validating simplification options.
/// </summary>
public sealed class ValidateSimplificationOptionsException : Exception
{
private readonly string propertyName;
/// <summary>
/// Creates a new simplification options validation exception.
/// </summary>
/// <param name="propertyName">The property name.</param>
/// <param name="message">The exception message.</param>
public ValidateSimplificationOptionsException(string propertyName, string message)
: base(message)
{
this.propertyName = propertyName;
}
/// <summary>
/// Creates a new simplification options validation exception.
/// </summary>
/// <param name="propertyName">The property name.</param>
/// <param name="message">The exception message.</param>
/// <param name="innerException">The exception that caused the validation error.</param>
public ValidateSimplificationOptionsException(string propertyName, string message, Exception innerException)
: base(message, innerException)
{
this.propertyName = propertyName;
}
/// <summary>
/// Gets the property name that caused the validation error.
/// </summary>
public string PropertyName
{
get { return propertyName; }
}
/// <summary>
/// Gets the message of the exception.
/// </summary>
public override string Message
{
get { return base.Message + Environment.NewLine + "Property name: " + propertyName; }
}
}
}
|