예제 #1
0
        private void configureViewToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TailFileConfig configFile = new TailFileConfig();
            SaveConfig(configFile);
            TailConfigForm configForm = new TailConfigForm(configFile, true);
            switch (configForm.ShowDialog(this))
            {
                case DialogResult.OK:
                {
                    LoadConfig(configForm.TailFileConfig, _configPath);
                    break;
                }

                case DialogResult.Retry:
                {
                    // Apply Config To All
                    LoadConfig(configForm.TailFileConfig, _configPath);
                    configFile = new TailFileConfig();
                    SaveConfig(configFile);
                    TailConfigApplyAllForm configFormApply = new TailConfigApplyAllForm();
                    if (configFormApply.ShowDialog(this) == DialogResult.OK)
                    {
                        // Then we loop through all forms (includes free floating)
                        foreach (Form childForm in Application.OpenForms)
                        {
                            TailForm tailForm = childForm as TailForm;
                            if (tailForm != null && tailForm != this)
                            {
                                TailFileConfig configFileOther = new TailFileConfig();
                                tailForm.SaveConfig(configFileOther);
                                if (configFormApply._checkBoxColors.Checked)
                                {
                                    configFileOther.FormBackColor = configFile.FormBackColor;
                                    configFileOther.FormTextColor = configFile.FormTextColor;
                                    configFileOther.FormBookmarkBackColor = configFile.FormBookmarkBackColor;
                                    configFileOther.FormBookmarkTextColor = configFile.FormBookmarkTextColor;
                                }
                                if (configFormApply._checkBoxFont.Checked)
                                    configFileOther.FontInvariant = configFile.FontInvariant;
                                if (configFormApply._checkboxKeywords.Checked)
                                    configFileOther.KeywordHighlight = configFile.KeywordHighlight;
                                if (configFormApply._checkboxTools.Checked)
                                    configFileOther.ExternalTools = configFile.ExternalTools;
                                tailForm.LoadConfig(configFileOther, _configPath);
                            }
                        }
                    }
                    break;
                }
            }
        }
예제 #2
0
 private void _configTextToolStripMenuItem_Click(object sender, EventArgs e)
 {
     TailFileConfig configFile = new TailFileConfig();
     SaveConfig(configFile);
     TailConfigForm configForm = new TailConfigForm(configFile, false);
     if (configForm.ShowDialog(this) == DialogResult.OK)
         LoadConfig(configForm.TailFileConfig, null);
 }