// 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 { /// /// Thrown when errors are encountered in content during processing. /// [SerializableAttribute] public class InvalidContentException : Exception { /// /// Gets or sets the identity of the content item that caused the exception. /// public ContentIdentity ContentIdentity { get; set; } /// /// Initializes a new instance of the InvalidContentException class /// public InvalidContentException() { } /// /// Initializes a new instance of the InvalidContentException class with information on serialization and streaming context for the related content item. /// /// Information necessary for serialization and deserialization of the content item. /// Information necessary for the source and destination of a given serialized stream. Also provides an additional caller-defined context. protected InvalidContentException( SerializationInfo serializationInfo, StreamingContext streamingContext ) { } /// /// Initializes a new instance of the InvalidContentException class with the specified error message. /// /// A message that describes the error. public InvalidContentException( string message ) : this(message, null, null) { } /// /// Initializes a new instance of the InvalidContentException class with the specified error message and the identity of the content throwing the exception. /// /// A message that describes the error. /// 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. public InvalidContentException( string message, ContentIdentity contentIdentity ) : this(message, contentIdentity, null) { } /// /// 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. /// /// A message that describes the error. /// 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. /// 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. public InvalidContentException( string message, ContentIdentity contentIdentity, Exception innerException ) : base(message, innerException) { ContentIdentity = contentIdentity; } /// /// 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. /// /// A message that describes the error. /// 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. public InvalidContentException( string message, Exception innerException ) : this(message, null, innerException) { } /// /// When overridden in a derived class, returns information about the exception. /// In addition to the base behavior, this method provides serialization functionality. /// /// Information necessary for serialization and deserialization of the content item. /// Information necessary for the source and destination of a given serialized stream. Also provides an additional caller-defined context. public override void GetObjectData( SerializationInfo info, StreamingContext context ) { base.GetObjectData(info, context); // TODO: Complete me... } } }