GetLocation() public method

Gets the location from an offset.
public GetLocation ( int offset ) : TextLocation
offset int
return TextLocation
        private static void AddFold(TextDocument document, ICollection<NewFolding> foldMarkers, int startOffset, int endOffset, string label)
        {
            // Do not add folding if start and end are on the same line.
            int startLine = document.GetLocation(startOffset).Line;
            int endLine = document.GetLocation(endOffset).Line;
            if (startLine >= endLine)
                return;

            foldMarkers.Add(new NewFolding(startOffset, endOffset) { Name = label });
        }
Esempio n. 2
0
            public D_Parser.Dom.CodeLocation ToLocation(int offset)
            {
                var dl = document.GetLocation(offset);

                return(new CodeLocation(dl.Column, dl.Line));
            }