// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; using System.Collections.Generic; using System.Windows.Media; namespace ILSpy.Debugger.AvalonEdit { /// /// Represents a text marker. /// public interface ITextMarker { /// /// Gets the start offset of the marked text region. /// int StartOffset { get; } /// /// Gets the end offset of the marked text region. /// int EndOffset { get; } /// /// Gets the length of the marked region. /// int Length { get; } /// /// Deletes the text marker. /// void Delete(); /// /// Gets whether the text marker was deleted. /// bool IsDeleted { get; } /// /// Event that occurs when the text marker is deleted. /// event EventHandler Deleted; /// /// Gets/Sets the background color. /// Color? BackgroundColor { get; set; } /// /// Gets/Sets the foreground color. /// Color? ForegroundColor { get; set; } /// /// Gets/Sets the type of the marker. Use TextMarkerType.None for normal markers. /// TextMarkerType MarkerType { get; set; } /// /// Gets/Sets the color of the marker. /// Color MarkerColor { get; set; } /// /// Gets/Sets an object with additional data for this text marker. /// object Tag { get; set; } /// /// Gets/Sets an object that will be displayed as tooltip in the text editor. /// object ToolTip { get; set; } } public enum TextMarkerType { /// /// Use no marker /// None, /// /// Use squiggly underline marker /// SquigglyUnderline } public interface ITextMarkerService { /// /// Creates a new text marker. The text marker will be invisible at first, /// you need to set one of the Color properties to make it visible. /// ITextMarker Create(int startOffset, int length); /// /// Gets the list of text markers. /// IEnumerable TextMarkers { get; } /// /// Removes the specified text marker. /// void Remove(ITextMarker marker); /// /// Removes all text markers that match the condition. /// void RemoveAll(Predicate predicate); } }