forked from MonoGame/MonoGame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
InvalidContentException.cs
108 lines (99 loc) · 5.08 KB
/
InvalidContentException.cs
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
using System;
using System.Runtime.Serialization;
namespace Microsoft.Xna.Framework.Content.Pipeline
{
/// <summary>
/// Thrown when errors are encountered in content during processing.
/// </summary>
[SerializableAttribute]
public class InvalidContentException : Exception
{
/// <summary>
/// Gets or sets the identity of the content item that caused the exception.
/// </summary>
public ContentIdentity ContentIdentity { get; set; }
/// <summary>
/// Initializes a new instance of the InvalidContentException class
/// </summary>
public InvalidContentException()
{
}
/// <summary>
/// Initializes a new instance of the InvalidContentException class with information on serialization and streaming context for the related content item.
/// </summary>
/// <param name="serializationInfo">Information necessary for serialization and deserialization of the content item.</param>
/// <param name="streamingContext">Information necessary for the source and destination of a given serialized stream. Also provides an additional caller-defined context.</param>
protected InvalidContentException(
SerializationInfo serializationInfo,
StreamingContext streamingContext
)
{
}
/// <summary>
/// Initializes a new instance of the InvalidContentException class with the specified error message.
/// </summary>
/// <param name="message">A message that describes the error.</param>
public InvalidContentException(
string message
)
: this(message, null, null)
{
}
/// <summary>
/// Initializes a new instance of the InvalidContentException class with the specified error message and the identity of the content throwing the exception.
/// </summary>
/// <param name="message">A message that describes the error.</param>
/// <param name="contentIdentity">Information about the content item that caused this error, including the file name. In some cases, a location within the file (of the problem) is specified.</param>
public InvalidContentException(
string message,
ContentIdentity contentIdentity
)
: this(message, contentIdentity, null)
{
}
/// <summary>
/// Initializes a new instance of the InvalidContentException class with the specified error message, the identity of the content throwing the exception, and a reference to the inner exception that is the cause of this exception.
/// </summary>
/// <param name="message">A message that describes the error.</param>
/// <param name="contentIdentity">Information about the content item that caused this error, including the file name. In some cases, a location within the file (of the problem) is specified.</param>
/// <param name="innerException">The exception that is the cause of the current exception. If innerException is not a null reference, the current exception is raised in a catch block that handles the inner exception.</param>
public InvalidContentException(
string message,
ContentIdentity contentIdentity,
Exception innerException
)
: base(message, innerException)
{
ContentIdentity = contentIdentity;
}
/// <summary>
/// Initializes a new instance of the InvalidContentException class with the specified error message and a reference to the inner exception that is the cause of this exception.
/// </summary>
/// <param name="message">A message that describes the error.</param>
/// <param name="innerException">The exception that is the cause of the current exception. If innerException is not a null reference, the current exception is raised in a catch block that handles the inner exception.</param>
public InvalidContentException(
string message,
Exception innerException
)
: this(message, null, innerException)
{
}
/// <summary>
/// When overridden in a derived class, returns information about the exception.
/// In addition to the base behavior, this method provides serialization functionality.
/// </summary>
/// <param name="info">Information necessary for serialization and deserialization of the content item.</param>
/// <param name="context">Information necessary for the source and destination of a given serialized stream. Also provides an additional caller-defined context.</param>
public override void GetObjectData(
SerializationInfo info,
StreamingContext context
)
{
base.GetObjectData(info, context);
// TODO: Complete me...
}
}
}