diff --git a/notus/Biblioteque_de_Class/Exception.cs b/notus/Biblioteque_de_Class/Exception.cs index a074c57..722af20 100644 --- a/notus/Biblioteque_de_Class/Exception.cs +++ b/notus/Biblioteque_de_Class/Exception.cs @@ -6,10 +6,16 @@ using System.Threading.Tasks; namespace Biblioteque_de_Class { + [Serializable] public class NotAllowedException : Exception { public NotAllowedException(string message) : base(message) { + + } + protected NotAllowedException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } } public class AlreadyUsedException : Exception diff --git a/notus/Biblioteque_de_Class/Note.cs b/notus/Biblioteque_de_Class/Note.cs index 216f430..efd1dba 100644 --- a/notus/Biblioteque_de_Class/Note.cs +++ b/notus/Biblioteque_de_Class/Note.cs @@ -102,6 +102,7 @@ namespace Biblioteque_de_Class { if (VerifyOwner(owner)) { Collaborators.Add(user); } else { throw new NotAllowedException("User is not the owner"); } + user.GetNoteList().Add(this); } /// @@ -111,6 +112,7 @@ namespace Biblioteque_de_Class { if (VerifyOwner(owner)) { Collaborators.Remove(user); } else { throw new NotAllowedException("User is not the owner"); } + user.GetNoteList().Remove(this); } ///