|
|
|
@ -54,7 +54,7 @@ namespace Biblioteque_de_Class
|
|
|
|
|
ModificationDate = DateOnly.FromDateTime(DateTime.Now);
|
|
|
|
|
ImageList = new List<NoteImage>();
|
|
|
|
|
Collaborators = new List<User>();
|
|
|
|
|
Editors = new List<User>();
|
|
|
|
|
Editors = new List<User>() { owner };
|
|
|
|
|
Owner = owner;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -74,9 +74,9 @@ namespace Biblioteque_de_Class
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="imageLink"></param>
|
|
|
|
|
/// <param name="position"></param>
|
|
|
|
|
public void AddImage(string imageLink, string position)
|
|
|
|
|
public void AddImage(string imageLink, List<int> position)
|
|
|
|
|
{
|
|
|
|
|
int newname = ImageList.Count + 1;
|
|
|
|
|
string newname = (ImageList.Count + 1).ToString();
|
|
|
|
|
ImageList.Add(new NoteImage(newname, imageLink, position));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -85,7 +85,7 @@ namespace Biblioteque_de_Class
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="name"></param>
|
|
|
|
|
/// <exception cref="NotFoundException"></exception>
|
|
|
|
|
public void RemoveImage(int name)
|
|
|
|
|
public void RemoveImage(string name)
|
|
|
|
|
{
|
|
|
|
|
foreach (NoteImage image in ImageList)
|
|
|
|
|
{
|
|
|
|
@ -140,6 +140,7 @@ namespace Biblioteque_de_Class
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void AddEditor(User owner, User user)
|
|
|
|
|
{
|
|
|
|
|
if (Editors.Contains(user)) { throw new AlreadyExistException("user already in editors."); }
|
|
|
|
|
if (VerifyOwner(owner)) { Editors.Add(user); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -148,6 +149,7 @@ namespace Biblioteque_de_Class
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void RemoveEditor(User owner, User user)
|
|
|
|
|
{
|
|
|
|
|
if (!Editors.Contains(user)) { throw new NotFoundException("user not found in editors."); }
|
|
|
|
|
if (VerifyOwner(owner)) { Editors.Remove(user); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|