private void mAdd_Click(object sender, EventArgs e)
        {
            var newRule = new DomainRule();

            if (newRule.ShowEditorDialog(this) == DialogResult.OK)
            {
                Rules.Instance.AddDomainRule(newRule);
                SaveAndUpdateList();
                mRules.SelectedObject = newRule;
            }
        }
Пример #2
0
        internal static void ShowAddDomainRule(string url)
        {
            var newRule = new DomainRule
            {
                DomainSuffix = Rules.GetDomain(url),
                Language     = InputLanguage.CurrentInputLanguage
            };

            if (newRule.ShowEditorDialog(sCurrentConfigDialog) == DialogResult.OK)
            {
                Rules.Instance.AddDomainRule(newRule);
                if (sCurrentConfigDialog != null)
                {
                    sCurrentConfigDialog.SaveAndUpdateList();
                }
                else
                {
                    Rules.Instance.Save();
                }
            }
        }