Files
JWLMerge/JWLMerge.BackupFileServices/Exceptions/WrongManifestVersionException.cs
2021-05-24 12:24:36 +01:00

32 lines
1.0 KiB
C#

namespace JWLMerge.BackupFileServices.Exceptions
{
using System;
using System.Runtime.Serialization;
[Serializable]
#pragma warning disable RCS1194 // Implement exception constructors.
public class WrongManifestVersionException : BackupFileServicesException
#pragma warning restore RCS1194 // Implement exception constructors.
{
public WrongManifestVersionException(string filename, int expectedVersion, int foundVersion)
: base($"Wrong manifest version found ({foundVersion}) in {filename}. Expecting {expectedVersion}")
{
Filename = filename;
ExpectedVersion = expectedVersion;
FoundVersion = foundVersion;
}
// Without this constructor, deserialization will fail
protected WrongManifestVersionException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
public string? Filename { get; }
public int ExpectedVersion { get; }
public int FoundVersion { get; }
}
}