private string SetThemes(string Name, Color A, Color B, Color C) { if (A.IsNamedColor == false || B.IsNamedColor == false || C.IsNamedColor == false) { return("Unnamed color will not work"); } Themes theme = new Themes(); theme.ThemeName = Name; theme.TextColor = B.Name; theme.BackColor = A.Name; theme.TopColor = C.Name; TCDataFiltering.ForeColor = Color.FromName(theme.TextColor); TCDataFiltering.BackColor = Color.FromName(theme.BackColor); TCSettings.BackColor = Color.FromName(theme.BackColor); TCSettings.ForeColor = Color.FromName(theme.TextColor); TCEmailTemplate.BackColor = Color.FromName(theme.BackColor); TCEmailTemplate.ForeColor = Color.FromName(theme.TextColor); TCEmail.BackColor = Color.FromName(theme.BackColor); TCEmail.ForeColor = Color.FromName(theme.TextColor); panel1.BackColor = Color.FromName(theme.TopColor); panel1.ForeColor = Color.FromName(theme.TextColor); TabControl1.Update(); var x = ThemesCollection.Contains(theme); ThemesCollection.themesList.Remove(x); ThemesCollection.themesList.Add(theme); return(null); }
private string SetThemes(string themeName) { Themes theme = ThemesCollection.Contains(themeName); if (theme == null) { return("This theme is not specified"); } TCDataFiltering.ForeColor = Color.FromName(theme.TextColor); TCDataFiltering.BackColor = Color.FromName(theme.BackColor); TCSettings.BackColor = Color.FromName(theme.BackColor); TCSettings.ForeColor = Color.FromName(theme.TextColor); TCEmailTemplate.BackColor = Color.FromName(theme.BackColor); TCEmailTemplate.ForeColor = Color.FromName(theme.TextColor); TCEmail.BackColor = Color.FromName(theme.BackColor); TCEmail.ForeColor = Color.FromName(theme.TextColor); panel1.BackColor = Color.FromName(theme.TopColor); panel1.ForeColor = Color.FromName(theme.TextColor); TabControl1.Update(); return("Theme is updated"); }