Exemplo n.º 1
0
 private bool checkScript()
 {
     if (txtSourceSQL.Text.ToLower().Contains("drop"))
     {
         DocumentPosition position = new DocumentPosition(this.txtSourceSQL.Document);
         do
         {
             string word = position.GetCurrentSpanBox().Text;
             if (word.ToLower() == "drop")
             {
                 DocumentPosition wordEndPosition = new DocumentPosition(position);
                 wordEndPosition.MoveToCurrentWordEnd();
                 txtSourceSQL.Document.Selection.AddSelectionStart(position);
                 txtSourceSQL.Document.Selection.AddSelectionEnd(wordEndPosition);
             }
         }while (position.MoveToNextWordStart());
         return(true);
     }
     else
     {
         return(false);
     }
 }