// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team // // Permission is hereby granted, free of charge, to any person obtaining a copy of this // software and associated documentation files (the "Software"), to deal in the Software // without restriction, including without limitation the rights to use, copy, modify, merge, // publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons // to whom the Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all copies or // substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. 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); } }