-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathUnsupportedFileFormatException.cs
More file actions
41 lines (30 loc) · 1.21 KB
/
UnsupportedFileFormatException.cs
File metadata and controls
41 lines (30 loc) · 1.21 KB
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
using System;
using System.Runtime.Serialization;
namespace Gsemac.IO {
[Serializable]
public sealed class UnsupportedFileFormatException :
FileFormatException {
// Public members
public UnsupportedFileFormatException(string message) :
base(message) {
}
public UnsupportedFileFormatException(string message, Exception innerException) :
base(message, innerException) {
}
public UnsupportedFileFormatException() :
base(GetExceptionMessage(fileFormat: null)) {
}
public UnsupportedFileFormatException(IFileFormat fileFormat) :
base(GetExceptionMessage(fileFormat)) {
}
// Private members
private UnsupportedFileFormatException(SerializationInfo serializationInfo, StreamingContext streamingContext) :
base(serializationInfo, streamingContext) {
}
private static string GetExceptionMessage(IFileFormat fileFormat) {
return fileFormat is null ?
Properties.ExceptionMessages.UnsupportedFileFormat :
string.Format(Properties.ExceptionMessages.UnsupportedFileFormatWithFormat, fileFormat);
}
}
}