// Новая схема
        private void bt_New_Click(object sender, EventArgs e)
        {
            SheetColorScheme cs = new SheetColorScheme();

            cs.Name = "Noname";
            schemes.Add(GetSchemeFromEditor());
            UpdateList();
            listBox1.SelectedIndex = listBox1.Items.Count - 1;
        }
Example #2
0
 public static void WriteToStream(ProjFileStream writer, SheetColorScheme scheme)
 {
     writer.WriteString(scheme.Name);
     writer.WriteColor(scheme.HeaderBackColor);
     writer.WriteColor(scheme.ValueBackColor);
     writer.WriteColor(scheme.TextColor);
     writer.WriteColor(scheme.SelectedBackColor);
     writer.WriteColor(scheme.LightingBackColor);
     writer.WriteColor(scheme.LightingSelectedBackColor);
 }
 // Загрузить схему в редактор
 private void LoadColorScheme(SheetColorScheme scs)
 {
     tb_Name.Text           = scs.Name;
     bt_HDBack.BackColor    = scs.HeaderBackColor;
     bt_VALBack.BackColor   = scs.ValueBackColor;
     bt_TXT.BackColor       = scs.TextColor;
     bt_SELBack.BackColor   = scs.SelectedBackColor;
     bt_LTBack.BackColor    = scs.LightingBackColor;
     bt_LTSELBack.BackColor = scs.LightingSelectedBackColor;
 }
Example #4
0
        public static SheetColorScheme ReadFromStream(ProjFileStream reader)
        {
            SheetColorScheme resultScheme = new SheetColorScheme();

            resultScheme.Name                      = reader.ReadString();
            resultScheme.HeaderBackColor           = reader.ReadColor();
            resultScheme.ValueBackColor            = reader.ReadColor();
            resultScheme.TextColor                 = reader.ReadColor();
            resultScheme.SelectedBackColor         = reader.ReadColor();
            resultScheme.LightingBackColor         = reader.ReadColor();
            resultScheme.LightingSelectedBackColor = reader.ReadColor();
            return(resultScheme);
        }
Example #5
0
        // Сохранение цветовых схем
        private void ColorSchemesWrite()
        {
            string colorFileName = Path.Combine(Application.StartupPath, "Colors");

            ProjFileStream writer = new ProjFileStream(colorFileName, FileMode.Create, FileAccess.Write);

            int cnt = schemes.Count;

            writer.WriteInt(cnt);
            for (int i = 0; i < cnt; i++)
            {
                SheetColorScheme.WriteToStream(writer, schemes[i]);
            }

            writer.Close();
        }
Example #6
0
        // Загрузка цветовых схем
        private void ColorSchemesRead()
        {
            schemes.Clear();
            string colorFileName = Path.Combine(Application.StartupPath, "Colors");

            if (File.Exists(colorFileName))
            {
                ProjFileStream reader = new ProjFileStream(colorFileName, FileMode.Open, FileAccess.Read);

                int cnt = reader.ReadInt();
                for (int i = 0; i < cnt; i++)
                {
                    schemes.Add(SheetColorScheme.ReadFromStream(reader));
                }

                reader.Close();
            }
            else
            {
                schemes.Add(new SheetColorScheme());
            }
        }
Example #7
0
 // Выбор цветовой схемы
 public void SelectColorScheme(SheetColorScheme cs)
 {
     currentCS = cs;
     UpdateColors();
 }