protected override void OnExecute(object parameter) { _indenter.IndentCurrentProcedure(); if (_state.Status >= ParserState.Ready || _state.Status == ParserState.Pending) { _state.OnParseRequested(this); } }
protected override void OnExecute(object parameter) { _indenter.IndentCurrentProcedure(); if (_state.Status >= ParserState.Ready || _state.Status == ParserState.Pending) { _state.OnParseRequested(this, _vbe.ActiveCodePane.CodeModule.Parent); } }
protected override void OnExecute(object parameter) { if (!CanExecute(parameter) || !(parameter is CodeExplorerItemViewModel node) || node.Declaration == null) { return; } switch (node) { case CodeExplorerProjectViewModel model: { var declaration = model.Declaration; var componentDeclarations = _state.AllUserDeclarations.Where(c => c.DeclarationType.HasFlag(DeclarationType.Module) && !c.Annotations.Any(pta => pta.Annotation is NoIndentAnnotation) && c.ProjectId == declaration.ProjectId); foreach (var componentDeclaration in componentDeclarations) { _indenter.Indent(_state.ProjectsProvider.Component(componentDeclaration.QualifiedName.QualifiedModuleName)); } break; } case CodeExplorerCustomFolderViewModel folder: { var components = folder.Children.OfType <CodeExplorerComponentViewModel>() //TODO: this has the filter applied. .Select(s => s.Declaration) .Where(d => !d.Annotations.Any(pta => pta.Annotation is NoIndentAnnotation)) .Select(d => _state.ProjectsProvider.Component(d.QualifiedName.QualifiedModuleName)); foreach (var component in components) { _indenter.Indent(component); } break; } case CodeExplorerComponentViewModel component: _indenter.Indent(_state.ProjectsProvider.Component(component.Declaration.QualifiedModuleName)); break; case CodeExplorerMemberViewModel member: if (!member.QualifiedSelection.HasValue) { return; } _navigateCommand.Execute(member.QualifiedSelection.Value.GetNavitationArgs()); _indenter.IndentCurrentProcedure(); break; } }
protected override void OnExecute(object parameter) { if (parameter == null) { return; } var node = (CodeExplorerItemViewModel)parameter; if (!node.QualifiedSelection.HasValue && !(node is CodeExplorerCustomFolderViewModel)) { return; } if (node is CodeExplorerProjectViewModel) { var declaration = ((ICodeExplorerDeclarationViewModel)node).Declaration; var componentDeclarations = _state.AllUserDeclarations.Where(c => c.DeclarationType.HasFlag(DeclarationType.Module) && c.Annotations.All(a => a.AnnotationType != AnnotationType.NoIndent) && c.ProjectId == declaration.ProjectId); foreach (var componentDeclaration in componentDeclarations) { _indenter.Indent(_state.ProjectsProvider.Component(componentDeclaration.QualifiedName.QualifiedModuleName)); } } if (node is CodeExplorerCustomFolderViewModel) { var components = node.Items.OfType <CodeExplorerComponentViewModel>() .Select(s => s.Declaration) .Where(d => d.Annotations.All(a => a.AnnotationType != AnnotationType.NoIndent)) .Select(d => _state.ProjectsProvider.Component(d.QualifiedName.QualifiedModuleName)); foreach (var component in components) { _indenter.Indent(component); } } if (node is CodeExplorerComponentViewModel) { _indenter.Indent(_state.ProjectsProvider.Component(node.QualifiedSelection.Value.QualifiedName)); } if (node is CodeExplorerMemberViewModel) { _navigateCommand.Execute(node.QualifiedSelection.Value.GetNavitationArgs()); _indenter.IndentCurrentProcedure(); } }
public override void Execute(object parameter) { _indenter.IndentCurrentProcedure(); }
protected override void ExecuteImpl(object parameter) { _indenter.IndentCurrentProcedure(); }
protected override void ExecuteImpl(object parameter) { _indenter.IndentCurrentProcedure(); _state.OnParseRequested(this, _vbe.ActiveCodePane.CodeModule.Parent); }