public FoldMarker(IDocument document, int startLine, int startColumn, int endLine, int endColumn, ICSharpCode.TextEditor.Document.FoldType foldType, string foldText, bool isFolded)
        {
            this.document = document;
            startLine     = Math.Min(document.TotalNumberOfLines - 1, Math.Max(startLine, 0));
            ISegment lineSegment = document.GetLineSegment(startLine);

            endLine = Math.Min(document.TotalNumberOfLines - 1, Math.Max(endLine, 0));
            ISegment segment = document.GetLineSegment(endLine);

            if (string.IsNullOrEmpty(foldText))
            {
                foldText = "...";
            }
            this.FoldType = foldType;
            this.foldText = foldText;
            this.offset   = lineSegment.Offset + Math.Min(startColumn, lineSegment.Length);
            this.length   = segment.Offset + Math.Min(endColumn, segment.Length) - this.offset;
            this.isFolded = isFolded;
        }
 public FoldMarker(IDocument document, int startLine, int startColumn, int endLine, int endColumn, ICSharpCode.TextEditor.Document.FoldType foldType, string foldText) : this(document, startLine, startColumn, endLine, endColumn, foldType, foldText, false)
 {
 }