public SymbolsViwer(ListView listView, ImageList imageList, bool showInThread, VisualPascalABCPlugins.InvokeDegegate beginInvoke, PascalABCCompiler.SourceFilesProviderDelegate sourceFilesProvider, VisualEnvironmentCompiler.ExecuteSourceLocationActionDelegate ExecuteSourceLocationAction) { this.listView = listView; this.imageList = imageList; this.showInThread = showInThread; this.beginInvoke = beginInvoke; this.sourceFilesProvider = sourceFilesProvider; this.ExecuteSourceLocationAction = ExecuteSourceLocationAction; listView.MouseDoubleClick += new MouseEventHandler(listView_MouseDoubleClick); }
public void ExecuteSourceLocationAction(PascalABCCompiler.SourceLocation SourceLocation,VisualPascalABCPlugins.SourceLocationAction Action) { if (SourceLocation.FileName!=null) OpenFile(SourceLocation.FileName); ICSharpCode.TextEditor.TextEditorControl editor = CurrentSyntaxEditor.OwnEdit; Point Beg = new Point(SourceLocation.BeginPosition.Column - 1, SourceLocation.BeginPosition.Line - 1); Point End = new Point(SourceLocation.EndPosition.Column, SourceLocation.EndPosition.Line - 1); switch (Action) { case SourceLocationAction.SelectAndGotoBeg: case SourceLocationAction.SelectAndGotoEnd: if (Action == SourceLocationAction.SelectAndGotoBeg) editor.ActiveTextAreaControl.Caret.Position = Beg; else editor.ActiveTextAreaControl.Caret.Position = End; editor.ActiveTextAreaControl.SelectionManager.SetSelection(Beg,End); SetFocusToEditor(); break; case SourceLocationAction.GotoBeg: case SourceLocationAction.GotoEnd: if (Action == SourceLocationAction.GotoBeg) editor.ActiveTextAreaControl.Caret.Position = Beg; else editor.ActiveTextAreaControl.Caret.Position = End; SetFocusToEditor(); break; } CurrentSyntaxEditor.CenterView(); }
public void ExecuteSourceLocationAction(PascalABCCompiler.SourceLocation SourceLocation, VisualPascalABCPlugins.SourceLocationAction Action) { if (Action != SourceLocationAction.NavigationGoto) NavigationLocationChanged(); if (SourceLocation.FileName != null) WorkbenchServiceFactory.FileService.OpenFile(SourceLocation.FileName, null, true); CodeFileDocumentTextEditorControl editor = CurrentSyntaxEditor.TextEditor; editor.ActiveTextAreaControl.SelectionManager.ClearSelection(); //Point Beg = new Point(SourceLocation.BeginPosition.Column - 1, SourceLocation.BeginPosition.Line - 1); //Point End = new Point(SourceLocation.EndPosition.Column, SourceLocation.EndPosition.Line - 1); ICSharpCode.TextEditor.TextLocation Beg = new ICSharpCode.TextEditor.TextLocation(SourceLocation.BeginPosition.Column - 1, SourceLocation.BeginPosition.Line - 1); ICSharpCode.TextEditor.TextLocation End = new ICSharpCode.TextEditor.TextLocation(SourceLocation.EndPosition.Column, SourceLocation.EndPosition.Line - 1); switch (Action) { case SourceLocationAction.SelectAndGotoBeg: case SourceLocationAction.SelectAndGotoEnd: case SourceLocationAction.FindSelection: if (Action == SourceLocationAction.SelectAndGotoBeg) editor.ActiveTextAreaControl.Caret.Position = Beg; else editor.ActiveTextAreaControl.Caret.Position = End; editor.ActiveTextAreaControl.SelectionManager.SetSelection(Beg, End); if (Action != SourceLocationAction.FindSelection) SetFocusToEditor(); break; case SourceLocationAction.NavigationGoto: case SourceLocationAction.GotoBeg: case SourceLocationAction.GotoEnd: if (Action == SourceLocationAction.GotoBeg || Action == SourceLocationAction.NavigationGoto) editor.ActiveTextAreaControl.Caret.Position = Beg; else editor.ActiveTextAreaControl.Caret.Position = End; SetFocusToEditor(); break; } if (Action != SourceLocationAction.NavigationGoto) { NavigationLocationChanged(); CurrentSyntaxEditor.CenterView(); } }
bool VisualPascalABCPlugins.IWorkbenchDocumentService.ContainsTab(VisualPascalABCPlugins.ICodeFileDocument tab) { return TabStack.Contains(tab as CodeFileDocumentControl); }