Example #1
0
        public void MarkErrors(ICompilable item, bool sourceHeader)
        {
            RemoveMarks();
            MarkerStrategy markers  = editor.Document.MarkerStrategy;
            string         filename = Compiler.SourceFile(item).ToLower();

            errors.Rows.Clear();

            foreach (CompilerError err in Errors(item, sourceHeader))
            {
                if (filename == err.FileName.ToLower())
                {
                    TextMarker marker = ErrMarker(err);
                    if (marker != null)
                    {
                        markers.AddMarker(marker);
                    }

                    // update data grid
                    DataGridViewRow row = new DataGridViewRow();

                    DataGridViewImageCell img = new DataGridViewImageCell();
                    if (err.IsWarning)
                    {
                        img.Value = Properties.Resources.warningimg;
                    }
                    else
                    {
                        img.Value = Properties.Resources.errorimg;
                    }
                    img.Tag = item;
                    row.Cells.Add(img);

                    DataGridViewTextBoxCell pos = new DataGridViewTextBoxCell();
                    pos.Value = err.Line.ToString() + ":" + err.Column.ToString();
                    row.Cells.Add(pos);

                    DataGridViewTextBoxCell text = new DataGridViewTextBoxCell();
                    text.Value          = CompilerErrors.Message(err);
                    text.Style.WrapMode = DataGridViewTriState.True;
                    text.Tag            = err;
                    row.Cells.Add(text);

                    errors.Rows.Add(row);
                    row.Resizable = DataGridViewTriState.False;
                }
            }

            errors.AutoResizeRows();
            if (item.CompilerResults.Errors.Count > 0)
            {
                ShowErrors();
            }
            editor.Refresh();
        }
Example #2
0
 public void Reset(ICompilable item)
 {
     text.Text = CompilerErrors.ToString(item.CompilerResults.Errors);
     text.Select(0, 0);
 }