Пример #1
0
 /// <summary>
 /// to add new custom themes
 /// </summary>
 /// <param name="g"></param>
 /// <param name="setCurrentTheme"></param>
 public void AddNewTheme(GradientColor g, bool setCurrentTheme)
 {
     themes.ThemesList.Add(g);
     if (setCurrentTheme)
     {
         themes.CurrentTheme = (byte)themes.ThemesList.IndexOf(g);
     }
 }
Пример #2
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            t.CurrentTheme = (byte)comboBox1.SelectedIndex;
            if (t.ThemesList == null)
            {
                t.GetAllThemeNames();
            }
            GradientColor g = t.GetCurrentTheme();

            themeName_lbl.Text = g.GradientColorName;
            fontColor_lbl.Text = g.FontForeColor.Name;
            color1_lbl.Text    = g.Color1.Name;
            color2_lbl.Text    = g.Color2.Name;
            angle_lbl.Text     = g.ColorAngle.ToString();
        }
Пример #3
0
        /// <summary>
        /// to add default themes if themes.json file is not there
        /// </summary>
        private static void AddDefaultThemes()
        {
            GradientColor theme1 = new GradientColor(Color.Black, Color.Gray, Color.White, 180F, "Theme 1");
            GradientColor theme2 = new GradientColor(Color.Crimson, Color.Brown, Color.White, 30F, "Theme 2");
            GradientColor theme3 = new GradientColor(Color.Green, Color.Blue, Color.White, 30F, "Theme 3");
            GradientColor theme4 = new GradientColor(Color.OrangeRed, Color.DarkBlue, Color.White, 30F, "Theme 4");
            GradientColor theme5 = new GradientColor(Color.DarkMagenta, Color.Purple, Color.White, 30F, "Theme 5");
            GradientColor theme6 = new GradientColor(Color.Black, Color.Black, Color.White, 30F, "Default");

            themes.CurrentTheme = 0;
            themes.ThemesList   = new List <GradientColor>();
            themes.ThemesList.Add(theme1);
            themes.ThemesList.Add(theme2);
            themes.ThemesList.Add(theme3);
            themes.ThemesList.Add(theme4);
            themes.ThemesList.Add(theme5);
            themes.ThemesList.Add(theme6);
        }