diff --git a/notus/Biblioteque_de_Class/Database.cs b/notus/Biblioteque_de_Class/Database.cs index 7af6c30..7629ee6 100644 --- a/notus/Biblioteque_de_Class/Database.cs +++ b/notus/Biblioteque_de_Class/Database.cs @@ -19,7 +19,6 @@ namespace Biblioteque_de_Class public List ThemeList { get; private set; } [DataMember] public List UserList { get; private set; } - public static Theme? DefaultTheme { get; internal set; } public Database() { @@ -142,25 +141,6 @@ namespace Biblioteque_de_Class ThemeList.Add(theme); } - /// - /// supprimer un theme dans la liste de theme - /// - public void RemoveTheme(Theme theme) - { - if (ThemeList.Contains(theme)) - { - if (theme.Name.Length > 6 && theme.Name[..6] != "Static" ) - { - throw new AlreadyUsedException("This theme is used a default theme."); - } - ThemeList.Remove(theme); - } - else - { - throw new NotFoundException("Theme not found."); - } - } - /// /// récupérer un theme /// @@ -179,40 +159,6 @@ namespace Biblioteque_de_Class throw new NotFoundException("Theme not found."); } - /// - /// modifier le nom d'un theme - /// - public void ModifyThemeName(Theme theme, string newName) - { - foreach (Theme existingTheme in ThemeList) - { - if (existingTheme.Name == theme.Name) - { - existingTheme.Name = newName; - return; - } - } - throw new NotFoundException("Theme not found."); - } - - /// - /// modifier la liste de couleur d'un theme - /// - public void ModifyThemeColorList(Theme theme, List newColorList) - { - foreach (Theme existingTheme in ThemeList) - { - if (existingTheme.Name == theme.Name) - { - for (int i = 0; i < 3; i++) - { - existingTheme.ChangeColor(existingTheme.ColorList[i], newColorList[i]); - } - return; - } - } - } - /// /// changer le pseudo d'un utilisateur /// @@ -231,9 +177,16 @@ namespace Biblioteque_de_Class user.Username = newUsername; } - public void SetDefaultTheme() + public bool VerifThemeNameNotTaken(string name) { - DefaultTheme = ThemeList[0]; + foreach (Theme theme in ThemeList) + { + if (theme.Name == name) + { + return false; + } + } + return true; } } } \ No newline at end of file