Beispiel #1
0
 private void findDialog1_ReplaceRequested(object sender, ReplaceEventArgs e)
 {
     this.SelectedText = e.ReplaceText;
     if (this.findDialog1.ReplaceAvailable)
     {
         this.textAfterReplace = this.Text;
     }
 }
Beispiel #2
0
        /// <summary>
        /// The find dialog has requested a replace operation on the most recently selected text
        /// </summary>
        private void findDialog1_ReplaceRequested(object sender, ReplaceEventArgs e)
        {
            // Unfortunately it does not seem possible to register this in the TextBox's undo stack
            SelectedText = e.ReplaceText;

            if (findDialog1.ReplaceAvailable)
            {
                textAfterReplace = Text;
            }
        }
Beispiel #3
0
        internal void Replace(string replaceText)
        {
            ReplaceEventArgs replaceEventArgs = new ReplaceEventArgs();

            replaceEventArgs.ReplaceText = replaceText;
            if (this.replaceRequested == null)
            {
                throw new Exception("No replace event handler supplied");
            }
            this.replaceRequested(this, replaceEventArgs);
        }
Beispiel #4
0
        /// <summary>
        /// Start a replace operation on the last selected text
        /// </summary>
        /// <param name="replaceText">The string to replace</param>
        internal void Replace(string replaceText)
        {
            ReplaceEventArgs args = new ReplaceEventArgs();
            args.ReplaceText = replaceText;

            if(replaceRequested==null)
            {
                throw new Exception("No replace event handler supplied");
            }
            replaceRequested(this, args);
        }
        /// <summary>
        /// The find dialog has requested a replace operation on the most recently selected text
        /// </summary>
        private void findDialog1_ReplaceRequested(object sender, ReplaceEventArgs e)
        {
            // Unfortunately it does not seem possible to register this in the RichTextBox's undo stack
            SelectedText = e.ReplaceText;

            if (findDialog1.ReplaceAvailable)
            {
                textAfterReplace = Rtf;
            }
        }