コード例 #1
0
ファイル: Bookmarks.cs プロジェクト: ikvm/pascalabcnet
 public static void Remove()
 {
     if (instance != null)
     {
         instance.Document.BookmarkManager.RemoveMark(instance);
         instance.RemoveMarker();
         instance = null;
     }
 }
コード例 #2
0
ファイル: Bookmarks.cs プロジェクト: ikvm/pascalabcnet
        /*public static void SetPosition(IViewContent viewContent, int makerStartLine, int makerStartColumn, int makerEndLine, int makerEndColumn)
         * {
         *  ITextEditorControlProvider tecp = viewContent as ITextEditorControlProvider;
         *  if (tecp != null)
         *      SetPosition(tecp.TextEditorControl.FileName, tecp.TextEditorControl.Document, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn);
         *  else
         *      Remove();
         * }*/

        public static void SetPosition(string fileName, IDocument document, int makerStartLine, int makerStartColumn, int makerEndLine, int makerEndColumn)
        {
            Remove();

            startLine   = makerStartLine;
            startColumn = makerStartColumn;
            endLine     = makerEndLine;
            endColumn   = makerEndColumn;

            LineSegment line = document.GetLineSegment(startLine - 1);

            instance = new CurrentLineBookmark(fileName, document, startLine - 1);
            document.BookmarkManager.AddMark(instance);
            document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.LinesBetween, startLine - 1, endLine - 1));
            document.CommitUpdate();
        }
コード例 #3
0
ファイル: Bookmarks.cs プロジェクト: lisiynos/pascalabcnet
 public static void Remove()
 {
     if (instance != null)
     {
         instance.Document.BookmarkManager.RemoveMark(instance);
         instance.RemoveMarker();
         instance = null;
     }
 }
コード例 #4
0
ファイル: Bookmarks.cs プロジェクト: lisiynos/pascalabcnet
        /*public static void SetPosition(IViewContent viewContent, int makerStartLine, int makerStartColumn, int makerEndLine, int makerEndColumn)
        {
            ITextEditorControlProvider tecp = viewContent as ITextEditorControlProvider;
            if (tecp != null)
                SetPosition(tecp.TextEditorControl.FileName, tecp.TextEditorControl.Document, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn);
            else
                Remove();
        }*/
		
        public static void SetPosition(string fileName, IDocument document, int makerStartLine, int makerStartColumn, int makerEndLine, int makerEndColumn)
        {
            Remove();

            startLine = makerStartLine;
            startColumn = makerStartColumn;
            endLine = makerEndLine;
            endColumn = makerEndColumn;

            LineSegment line = document.GetLineSegment(startLine - 1);
            instance = new CurrentLineBookmark(fileName, document, startLine - 1);
            document.BookmarkManager.AddMark(instance);
            document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.LinesBetween, startLine - 1, endLine - 1));
            document.CommitUpdate();
        }