예제 #1
0
 private void findDialog1_ReplaceRequested(object sender, ReplaceEventArgs e)
 {
     this.SelectedText = e.ReplaceText;
     if (this.findDialog1.ReplaceAvailable)
     {
         this.textAfterReplace = this.Text;
     }
 }
예제 #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;
            }
        }
예제 #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);
        }
예제 #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;
            }
        }