Exemplo n.º 1
0
 public WindowChangedEventArgs(IntPtr hwnd, IWindow window, ICodePane pane, FocusType type)
 {
     Hwnd      = hwnd;
     Window    = window;
     CodePane  = pane;
     EventType = type;
 }
Exemplo n.º 2
0
 public DeclarationChangedEventArgs(ICodePane pane, Declaration declaration, IVBComponent component = null, bool multipleControls = false)
 {
     ActivePane  = pane;
     Declaration = declaration;
     VBComponent = component;
     MultipleControlsSelected = multipleControls;
 }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
        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}");
        }
Exemplo n.º 6
0
        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;
            }
        }
Exemplo n.º 7
0
 private static Selection GetSelection(ICodePane codePane)
 {
     return(codePane.Selection);
 }
Exemplo n.º 8
0
 public Declaration FindSelectedDeclaration(ICodePane activeCodePane)
 {
     return(DeclarationFinder?.FindSelectedDeclaration(activeCodePane));
 }
Exemplo n.º 9
0
 public bool Equals(ICodePane other)
 {
     return(Equals(other as SafeComWrapper <VB.CodePane>));
 }
Exemplo n.º 10
0
 public SelectionChangedEventArgs(ICodePane pane)
 {
     CodePane = pane;
 }
Exemplo n.º 11
0
 public bool Equals(ICodePane other)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 12
0
 public Declaration FindSelectedDeclaration(ICodePane activeCodePane, bool procedureLevelOnly = false)
 {
     return(DeclarationFinder?.FindSelectedDeclaration(activeCodePane));
 }
 private Declaration FindCodePaneTarget(ICodePane codePane)
 {
     return(_state.FindSelectedDeclaration(codePane));
 }
Exemplo n.º 14
0
 internal CodePaneSubclass(IntPtr hwnd, ICodePane pane) : base(hwnd)
 {
     _pane = pane;
 }