示例#1
0
 private void CancelRuleMode()
 {
     RuleMode = RuleModes.None;
     ActivateSelectButtons(false);
     ActivateRuleButtons(true);
     UpdateMuStr();
 }
示例#2
0
 private void CancelRuleMode()
 {
     RuleMode = RuleModes.None;
     ActivateSelectButtons(System.Windows.Visibility.Hidden);
     ActivateRuleButtons(System.Windows.Visibility.Visible);
     UpdateMuStr();
 }
示例#3
0
        private void StartDeleteUU()
        {
            // delete an occurance of UU

            int count = 0;

            // first, count how many occurances of UU exist
            for (int i = 0; WorkStr.Substring(i).Length >= 2; i++)
            {
                if (WorkStr.Substring(i).StartsWith("UU"))
                {
                    count++;
                }
            }

            // none?  just show a message
            if (count == 0)
            {
                MessageBox.Show("There is no occurance of 'UU' in the current string.");
            }
            else
            {
                // just 1? then just replace it
                if (count == 1)
                {
                    DeleteUU(WorkStr.IndexOf("UU"));
                }
                else
                {
                    // it looks like we'll have to let the user select which occurance
                    RuleMode = RuleModes.Rule4;
                    ActivateSelectButtons(true);
                    ActivateRuleButtons(false);
                    SelectorPos = -1;
                    NextSelector();
                }
                UpdateMuStr();
            }
        }
示例#4
0
        private void StartReplace3IWithU()
        {
            // replace an occurance of III with U

            int count = 0;

            // first, count how many occurances of III exist
            for (int i = 0; WorkStr.Substring(i).Length >= 3; i++)
            {
                if (WorkStr.Substring(i).StartsWith("III"))
                {
                    count++;
                }
            }

            // none?  just show a message
            if (count == 0)
            {
                MessageBox.Show("There is no occurance of 'III' in the current string.");
            }
            else
            {
                // just 1? then just replace it
                if (count == 1)
                {
                    Replace3IWithU(WorkStr.IndexOf("III"));
                }
                else
                {
                    // it looks like we'll have to let the user select which occurance
                    RuleMode = RuleModes.Rule3;
                    ActivateSelectButtons(System.Windows.Visibility.Visible);
                    ActivateRuleButtons(System.Windows.Visibility.Hidden);
                    SelectorPos = -1;
                    NextSelector();
                }
                UpdateMuStr();
            }
        }