public WindowChangedEventArgs(IntPtr hwnd, IWindow window, ICodePane pane, FocusType type) { Hwnd = hwnd; Window = window; CodePane = pane; EventType = type; }
public DeclarationChangedEventArgs(ICodePane pane, Declaration declaration, IVBComponent component = null, bool multipleControls = false) { ActivePane = pane; Declaration = declaration; VBComponent = component; MultipleControlsSelected = multipleControls; }
public CodeModule(IVBE vbe, string name, string content, IVBComponent component, ICodePane codePane) { VBE = vbe; Name = name; _lines = content.Split(new[] { Environment.NewLine }, StringSplitOptions.None).ToList(); Parent = component; CodePane = codePane; }
public string Format(ICodePane activeCodePane, Declaration declaration) { if (activeCodePane == null) { return(string.Empty); } var qualifiedSelection = activeCodePane.GetQualifiedSelection(); if (declaration == null || !qualifiedSelection.HasValue) { return(string.Empty); } var selection = qualifiedSelection.Value; var codePaneSelectionText = selection.Selection.ToString(); var contextSelectionText = FormatDeclaration(declaration); return(string.Format("{0} | {1}", codePaneSelectionText, contextSelectionText)); }
public async Task <string> FormatAsync(ICodePane activeCodePane, Declaration declaration, CancellationToken token) { if (activeCodePane == null) { return(string.Empty); } var qualifiedSelection = activeCodePane.GetQualifiedSelection(); if (declaration == null || !qualifiedSelection.HasValue) { return(string.Empty); } var selection = qualifiedSelection.Value; var codePaneSelectionText = selection.Selection.ToString(); var contextSelectionText = await FormatDeclarationAsync(declaration, token); return($"{codePaneSelectionText} | {contextSelectionText}"); }
private void ResetSelection(ICodePane codePane, Selection initialSelection) { using (var window = _vbe.ActiveWindow) { if (initialSelection == default || codePane == null || window == null || window.IsWrappingNullReference || window.Type != WindowKind.CodeWindow || codePane.IsWrappingNullReference) { return; } } using (var module = codePane.CodeModule) { // This will only "ballpark it" for now - it sets the absolute line in the module, not necessarily // the specific LoC. That will be a TODO when the parse tree is used to indent. For the time being, // maintaining that is ridiculously difficult vis-a-vis the payoff if the vertical spacing is // changed. var lines = module.CountOfLines; codePane.Selection = lines < initialSelection.StartLine ? new Selection(lines, initialSelection.StartColumn, lines, initialSelection.StartColumn) : initialSelection; } }
private static Selection GetSelection(ICodePane codePane) { return(codePane.Selection); }
public Declaration FindSelectedDeclaration(ICodePane activeCodePane) { return(DeclarationFinder?.FindSelectedDeclaration(activeCodePane)); }
public bool Equals(ICodePane other) { return(Equals(other as SafeComWrapper <VB.CodePane>)); }
public SelectionChangedEventArgs(ICodePane pane) { CodePane = pane; }
public bool Equals(ICodePane other) { throw new NotImplementedException(); }
public Declaration FindSelectedDeclaration(ICodePane activeCodePane, bool procedureLevelOnly = false) { return(DeclarationFinder?.FindSelectedDeclaration(activeCodePane)); }
private Declaration FindCodePaneTarget(ICodePane codePane) { return(_state.FindSelectedDeclaration(codePane)); }
internal CodePaneSubclass(IntPtr hwnd, ICodePane pane) : base(hwnd) { _pane = pane; }