Example #1
0
            public static ErrorMarker Create(EditorDocument EditorDoc, GenericError Error)
            {
                var em = new ErrorMarker(EditorDoc, Error);

                em.ForegroundColor = Error.ForegroundColor;
                em.BackgroundColor = Error.BackgroundColor;
                if (Error.MarkerColor.HasValue)
                {
                    em.MarkerColor = Error.MarkerColor.Value;
                }

                // Init offsets manually
                try
                {
                    if (Error.Line >= EditorDoc.Editor.Document.LineCount)
                    {
                        return(null);
                    }

                    if (Error.Line == EditorDoc.Editor.Document.LineCount - 1 &&
                        EditorDoc.Editor.Document.Lines[Error.Line].Length > Error.Column)
                    {
                        return(null);
                    }

                    em.StartOffset = EditorDoc.Editor.Document.GetOffset(Error.Line, Error.Column);
                }
                catch
                {
                    return(null);
                }

                if (Error.Length > 0)
                {
                    em.Length = Error.Length;
                }
                else
                {
                    em.CalculateWordOffset(em.StartOffset, false);
                }

                return(em);
            }
Example #2
0
 ErrorMarker(EditorDocument EditorDoc, GenericError Error)
     : base(EditorDoc.MarkerStrategy)
 {
     this.EditorDocument = EditorDoc;
     this.Error          = Error;
 }