protected override Task <CommandStatusResult> GetCommandStatusAsync(IProjectTree node, bool focused, string commandText, CommandStatus progressiveStatus) { if (node.IsRoot()) { return(GetCommandStatusResult.Handled(commandText, CommandStatus.Enabled)); } return(GetCommandStatusResult.Unhandled); }
protected override async Task <CommandStatusResult> GetCommandStatusAsync(IProjectTree node, bool focused, string commandText, CommandStatus progressiveStatus) { if (!CanMove(node)) { return(await GetCommandStatusResult.Handled(commandText, CommandStatus.Ninched).ConfigureAwait(true)); } return(await GetCommandStatusResult.Handled(commandText, CommandStatus.Enabled).ConfigureAwait(true)); }
protected override Task <CommandStatusResult> GetCommandStatusAsync(IProjectTree node, bool focused, string?commandText, CommandStatus progressiveStatus) { if (CanNavigateTo(node)) { return(GetCommandStatusResult.Handled(commandText, progressiveStatus | CommandStatus.Enabled)); } return(GetCommandStatusResult.Unhandled); }
protected override Task <CommandStatusResult> GetCommandStatusAsync(IImmutableSet <IProjectTree> nodes, bool focused, string?commandText, CommandStatus progressiveStatus) { // Only handle when Solution Explorer has focus so that we don't take over Tab Well handling if (focused && nodes.All(CanOpen)) { return(GetCommandStatusResult.Handled(commandText, progressiveStatus | CommandStatus.Enabled)); } return(GetCommandStatusResult.Unhandled); }
protected override Task <CommandStatusResult> GetCommandStatusAsync(IProjectTree node, bool focused, string commandText, CommandStatus progressiveStatus) { // We assume that if the AppDesignerTreeModifier marked an AppDesignerFolder, that we must support the Project Designer if (node.Flags.Contains(ProjectTreeFlags.Common.AppDesignerFolder)) { return(GetCommandStatusResult.Handled(commandText, CommandStatus.Enabled)); } return(GetCommandStatusResult.Unhandled); }
public Task <CommandStatusResult> GetCommandStatusAsync(IImmutableSet <IProjectTree> nodes, long commandId, bool focused, string commandText, CommandStatus progressiveStatus) { Requires.NotNull(nodes, nameof(nodes)); if (nodes.Count == 1 && _projectTree.NodeCanHaveAdditions(nodes.First()) && TryGetTemplateDetails(commandId, out _)) { return(GetCommandStatusResult.Handled(commandText, CommandStatus.Enabled)); } return(GetCommandStatusResult.Unhandled); }
protected override Task <CommandStatusResult> GetCommandStatusAsync(IProjectTree node, bool focused, string commandText, CommandStatus progressiveStatus) { if (_projectTree.NodeCanHaveAdditions(GetNodeToAddTo(node)) && CanAdd(node)) { return(GetCommandStatusResult.Handled(commandText, CommandStatus.Enabled)); } else { return(GetCommandStatusResult.Unhandled); } }
protected override Task <CommandStatusResult> GetCommandStatusAsync(IProjectTree node, bool focused, string commandText, CommandStatus progressiveStatus) { if (_addItemDialogService.CanAddNewOrExistingItemTo(GetNodeToAddTo(node)) && CanAdd(node)) { return(GetCommandStatusResult.Handled(commandText, CommandStatus.Enabled)); } else { return(GetCommandStatusResult.Unhandled); } }
public Task <CommandStatusResult> GetCommandStatusAsync(IImmutableSet <IProjectTree> nodes, long commandId, bool focused, string?commandText, CommandStatus progressiveStatus) { Requires.NotNull(nodes, nameof(nodes)); if (nodes.Count == 1 && _addItemDialogService.CanAddNewOrExistingItemTo(nodes.First()) && TryGetTemplateDetails(commandId, out _)) { return(GetCommandStatusResult.Handled(commandText, CommandStatus.Enabled)); } return(GetCommandStatusResult.Unhandled); }
protected override async Task <CommandStatusResult> GetCommandStatusAsync(IProjectTree node, bool focused, string?commandText, CommandStatus progressiveStatus) { if (ShouldHandle(node)) { // Enable the command if the build manager is ready to build. CommandStatus commandStatus = await IsReadyToBuildAsync() ? CommandStatus.Enabled : CommandStatus.Supported; return(await GetCommandStatusResult.Handled(GetCommandText(), commandStatus)); } return(CommandStatusResult.Unhandled); }
protected override Task <CommandStatusResult> GetCommandStatusAsync(IProjectTree node, bool focused, string?commandText, CommandStatus progressiveStatus) { progressiveStatus |= CommandStatus.Invisible; return(GetCommandStatusResult.Handled(commandText, progressiveStatus)); }
protected override Task <CommandStatusResult> GetCommandStatusAsync(IProjectTree node, bool focused, string?commandText, CommandStatus progressiveStatus) { return(GetCommandStatusResult.Handled( commandText, CanMove(node) ? CommandStatus.Enabled : CommandStatus.Ninched)); }
protected override Task <CommandStatusResult> GetCommandStatusAsync(IProjectTree node, bool focused, string commandText, CommandStatus progressiveStatus) => ShouldHandle(node) ? GetCommandStatusResult.Handled(GetCommandText(node), CommandStatus.Enabled) : GetCommandStatusResult.Unhandled;
protected override Task <CommandStatusResult> GetCommandStatusAsync(IImmutableSet <IProjectTree> nodes, bool focused, string commandText, CommandStatus progressiveStatus) { // Similar to other commands such as Add Reference, Project.EditProjectFile command // should be available regardless of what nodes are selected. return(GetCommandStatusResult.Handled(GetCommandText(), CommandStatus.Enabled)); }