namespace RhythmBase.Exceptions
{
///
/// Exception thrown when an attempt to overwrite a file is not allowed.
///
///
/// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
///
/// The file path that caused the exception.
/// The type that caused the exception.
public class OverwriteNotAllowedException(string filepath, Type referType) : RhythmBaseException(filepath)
{
///
/// Gets or sets the file path that caused the exception.
///
public string FilePath { get; set; } = filepath;
///
/// Gets the message that describes the current exception.
///
public override string Message => string.Format("Cannot save file '{0}' because overwriting is disabled by the settings and a file with the same name already exists.\r\nTo correct this, change the path or filename or set the OverWrite property of {1} to false.", FilePath, _referType.Name);
private readonly Type _referType = referType;
}
}