void validate()
 {
     if (!changed)
     {
         return;
     }
     bitmapPreprocessorClassDefinition.Document.MarkerStrategy.RemoveAll(marker => true);
     if (!string.IsNullOrWhiteSpace(Compiler.RemoveComments(bitmapPreprocessorClassDefinition.Text)))
     {
         try
         {
             BitmapPreprocessor.CompileBitmapPreprocessorType(bitmapPreprocessorClassDefinition.Text);//checking
         }
         catch (Compiler.Exception ex)
         {
             foreach (Compiler.Error ce in ex.Data.Values)
             {
                 ICSharpCode.TextEditor.Document.TextMarker tm = new ICSharpCode.TextEditor.Document.TextMarker(ce.P1, ce.P2 - ce.P1, ICSharpCode.TextEditor.Document.TextMarkerType.WaveLine, System.Drawing.Color.Red);
                 tm.ToolTip = ce.Message;
                 bitmapPreprocessorClassDefinition.Document.MarkerStrategy.AddMarker(tm);
             }
             throw;
         }
     }
 }
        public List <ICSharpCode.TextEditor.Document.TextMarker> GetMarkers(int offset, int length)
        {
            int num = offset + length - 1;
            List <ICSharpCode.TextEditor.Document.TextMarker> textMarkers = new List <ICSharpCode.TextEditor.Document.TextMarker>();

            for (int i = 0; i < this.textMarker.Count; i++)
            {
                ICSharpCode.TextEditor.Document.TextMarker item = this.textMarker[i];
                if (item.Offset <= offset && offset <= item.EndOffset || item.Offset <= num && num <= item.EndOffset || offset <= item.Offset && item.Offset <= num || offset <= item.EndOffset && item.EndOffset <= num)
                {
                    textMarkers.Add(item);
                }
            }
            return(textMarkers);
        }
 public List <ICSharpCode.TextEditor.Document.TextMarker> GetMarkers(int offset)
 {
     if (!this.markersTable.ContainsKey(offset))
     {
         List <ICSharpCode.TextEditor.Document.TextMarker> textMarkers = new List <ICSharpCode.TextEditor.Document.TextMarker>();
         for (int i = 0; i < this.textMarker.Count; i++)
         {
             ICSharpCode.TextEditor.Document.TextMarker item = this.textMarker[i];
             if (item.Offset <= offset && offset <= item.EndOffset)
             {
                 textMarkers.Add(item);
             }
         }
         this.markersTable[offset] = textMarkers;
     }
     return(this.markersTable[offset]);
 }
Beispiel #4
0
        private void FillScript(List <KeyValuePair <string, Color> > Lines, ICSharpCode.TextEditor.TextEditorControl TextBox)
        {
            var script = new StringBuilder();

            foreach (var item in Lines)
            {
                script.AppendLine(item.Key);
            }
            TextBox.Text = script.ToString();
            for (int i = 0; i < Lines.Count; i++)
            {
                if (Lines[i].Value == Color.Blue ||
                    Lines[i].Value == Color.Green ||
                    Lines[i].Value == Color.Red)
                {
                    ICSharpCode.TextEditor.Document.TextMarker marker = new ICSharpCode.TextEditor.Document.TextMarker(TextBox.Document.LineSegmentCollection[i].Offset, TextBox.Document.LineSegmentCollection[i].Length, ICSharpCode.TextEditor.Document.TextMarkerType.SolidBlock, Color.White, Lines[i].Value);
                    TextBox.Document.MarkerStrategy.AddMarker(marker);
                }
            }
        }
Beispiel #5
0
 void validate()
 {
     if (PreprocessBitmap.Checked)
     {
         bitmapPreprocessorClassDefinition.Document.MarkerStrategy.RemoveAll(marker => true);
         try
         {
             BitmapPreprocessor.GetCompiledBitmapPreprocessorType(bitmapPreprocessorClassDefinition.Text);//checking
         }
         catch (BitmapPreprocessor.CompilationException ex)
         {
             foreach (BitmapPreprocessor.CompilationError ce in ex.Data.Values)
             {
                 ICSharpCode.TextEditor.Document.TextMarker tm = new ICSharpCode.TextEditor.Document.TextMarker(ce.P1, ce.P2 - ce.P1, ICSharpCode.TextEditor.Document.TextMarkerType.WaveLine, System.Drawing.Color.Red);
                 tm.ToolTip = ce.Message;
                 bitmapPreprocessorClassDefinition.Document.MarkerStrategy.AddMarker(tm);
             }
             throw ex;
         }
     }
 }
 public void InsertMarker(int index, ICSharpCode.TextEditor.Document.TextMarker item)
 {
     this.markersTable.Clear();
     this.textMarker.Insert(index, item);
 }
 public void AddMarker(ICSharpCode.TextEditor.Document.TextMarker item)
 {
     this.markersTable.Clear();
     this.textMarker.Add(item);
 }