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;
         }
     }
 }
Exemplo n.º 2
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;
         }
     }
 }