fyiReporting.RdlDesign.RdlEditPreview.ReplaceAll C# (CSharp) Method

ReplaceAll() public method

public ReplaceAll ( Control ctl, string str, string strReplace, bool matchCase ) : void
ctl System.Windows.Forms.Control
str string
strReplace string
matchCase bool
return void
        public void ReplaceAll(Control ctl, string str, string strReplace, bool matchCase)
        {
            if (_CurrentTab != DesignTabs.Edit)
                return;

            scintilla1.TargetStart = 0;
            scintilla1.TargetEnd = scintilla1.TextLength;
            scintilla1.SearchFlags = matchCase ? SearchFlags.MatchCase : SearchFlags.None;
            while (scintilla1.SearchInTarget(str) != -1)
            {
                scintilla1.ReplaceTarget(strReplace);

                // Search the remainder of the document
                scintilla1.TargetStart = scintilla1.TargetEnd;
                scintilla1.TargetEnd = scintilla1.TextLength;
            }
        }

Usage Example

Example #1
0
 private void btnReplaceAll_Click(object sender, System.EventArgs e)
 {
     rdlEdit.ReplaceAll(this, txtFindR.Text, txtReplace.Text, chkCase.Checked);
     txtFindR.Focus();
 }