Beispiel #1
0
 public WordReference GetReference(WordReference fromReference)
 {
     if (fromReference.Document == wordPointer.Document)
     {
         return(new WordReference(wordPointer.Document, wordPointer.ParsedDocument, fromReference.Index, wordPointer.Index + wordPointer.Length - fromReference.Index));
     }
     else
     {
         return(new WordReference(wordPointer.Document, wordPointer.ParsedDocument, fromReference.Index, fromReference.Document.Length - fromReference.Index));
     }
 }
Beispiel #2
0
        public void AddError(WordReference fromReference, string message)
        {
            if (ParsedDocument == null)
            {
                return;
            }

            if (ParsedDocument is Tcl.ParsedDocument && (ParsedDocument as Tcl.ParsedDocument).ErrorCount < 100)
            {
                int lineNo = Document.GetLineAt(index);
//                ParsedDocument.Messages.Add(new Tcl.ParsedDocument.Message(message, Tcl.ParsedDocument.Message.MessageType.Error, index, lineNo, length, ParsedDocument.ItemID, ParsedDocument.Project));
            }
            else if (ParsedDocument is Tcl.ParsedDocument && (ParsedDocument as Tcl.ParsedDocument).ErrorCount == 100)
            {
//                ParsedDocument.Messages.Add(new Tcl.ParsedDocument.Message(">100 errors", Tcl.ParsedDocument.Message.MessageType.Error, 0, 0, 0, ParsedDocument.ItemID, ParsedDocument.Project));
            }

            if (fromReference.Document == Document)
            {
                for (int i = fromReference.Index; i < index + length; i++)
                {
                    Document.SetMarkAt(i, 0);
                }
            }
            else
            {
                for (int i = index; i < index + length; i++)
                {
                    Document.SetMarkAt(i, 0);
                }
            }
            if (ParsedDocument is Tcl.ParsedDocument)
            {
                (ParsedDocument as Tcl.ParsedDocument).ErrorCount++;
            }
        }