diff --git a/Sources/CoreLibrary/Exceptions/CodeCompletException.cs b/Sources/CoreLibrary/Exceptions/CodeCompletException.cs index 10fb7d0..f09a7e0 100644 --- a/Sources/CoreLibrary/Exceptions/CodeCompletException.cs +++ b/Sources/CoreLibrary/Exceptions/CodeCompletException.cs @@ -5,6 +5,7 @@ namespace CoreLibrary.Exceptions /// /// Exception levée lorsqu'un jeton est ajouté à un code déjà complet. /// + [Serializable] public class CodeCompletException : Exception { // Message par défaut diff --git a/Sources/CoreLibrary/Exceptions/CodeIncompletException.cs b/Sources/CoreLibrary/Exceptions/CodeIncompletException.cs index 23fecdf..5e096a5 100644 --- a/Sources/CoreLibrary/Exceptions/CodeIncompletException.cs +++ b/Sources/CoreLibrary/Exceptions/CodeIncompletException.cs @@ -5,15 +5,9 @@ namespace CoreLibrary.Exceptions /// /// Exception levée lorsqu'un code incomplet est ajouté à la grille. /// - [DataContract] + [Serializable] public class CodeIncompletException : Exception { - [DataMember] - public int CodeErreur { get; private set; } = 1000; - - [DataMember] - public string Details { get; private set; } = String.Empty; - // Message par défaut private const string messageDefaut = "Le code que vous essayez d'ajouter dans la grille n'est pas complet."; @@ -35,17 +29,13 @@ namespace CoreLibrary.Exceptions public CodeIncompletException(string message, Exception exception) : base(message, exception) { } - public CodeIncompletException(string message, int codeErreur, string details) : base(message) - { - CodeErreur = codeErreur; - Details = details; - } + [Obsolete("This method is obsolete. Use alternative methods for data retrieval.", DiagnosticId = "SYSLIB0051")] + protected CodeIncompletException(SerializationInfo info, StreamingContext contexte) : base(info, contexte) { } - protected CodeIncompletException(SerializationInfo info, StreamingContext contexte) - : base(info.GetString("Message"), null) + [Obsolete("This method is obsolete. Use alternative methods for data retrieval.", DiagnosticId = "SYSLIB0051")] + public override void GetObjectData(SerializationInfo info, StreamingContext context) { - CodeErreur = info.GetInt32(nameof(CodeErreur)); - Details = info.GetString(nameof(Details)) ?? ""; + base.GetObjectData(info, context); } } }