Example #1
0
 private void 从文件读取_Click(object sender, EventArgs e)
 {
     if (openScheme.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         ColorScheme  scheme = new ColorScheme();
         StreamReader reader = new StreamReader(openScheme.FileName, Encoding.Default);
         int          length = ColorScheme.Size;
         string[]     lists  = new string[length];
         try
         {
             for (int i = 0; i < length; i++)
             {
                 lists[i] = reader.ReadLine();
             }
             scheme.initInString(lists);
             MainDV.setScheme(scheme);
         }
         catch (Exception ex)
         {
             MessageBox.Show("该文件损坏");
             return;
         }
         MainDV.Flash();
     }
 }
Example #2
0
        private void 编辑颜色_Click(object sender, EventArgs e)
        {
            SchemeEditor editor = new SchemeEditor();

            editor.EditScheme(MainDV.Scheme);
            if (editor.ChangeScheme)
            {
                MainDV.setScheme(editor.scheme);
            }
        }