/// <summary> /// Executes a command from the standard Visual Studio 97 command set. /// </summary> /// <param name="command">The command to execute.</param> /// <returns>true if the command is supported; otherwise, false.</returns> public override bool ExecuteStandard97Command(VsCommand command) { bool supported = true; switch (command) { case VsCommand.NewFolder: { // We'll create a new folder, then immediately give the user a chance to rename it. // The code in for the Caption setter will make sure to rename the node and directory. string folderName = this.GenerateUniqueName("NewFolder", String.Empty, true); FolderNode folderNode = this.Hierarchy.CreateAndAddFolder(this, folderName); folderNode.StartNodeEdit(); break; } case VsCommand.AddNewItem: this.Hierarchy.ShowAddFileDialogBox(this, AddFileDialogType.AddNew); break; case VsCommand.AddExistingItem: this.Hierarchy.ShowAddFileDialogBox(this, AddFileDialogType.AddExisting); break; default: supported = base.ExecuteStandard97Command(command); break; } return(supported); }
/// <summary> /// Executes a command from the standard Visual Studio 97 command set. /// </summary> /// <param name="command">The command to execute.</param> /// <returns>true if the command is supported; otherwise, false.</returns> public override bool ExecuteStandard97Command(VsCommand command) { bool supported = true; switch (command) { case VsCommand.BuildCtx: case VsCommand.BuildSel: this.Hierarchy.AttachedProject.StartBuild(BuildOperation.Build); break; case VsCommand.RebuildCtx: case VsCommand.RebuildSel: this.Hierarchy.AttachedProject.StartBuild(BuildOperation.Rebuild); break; case VsCommand.CleanCtx: case VsCommand.CleanSel: this.Hierarchy.AttachedProject.StartBuild(BuildOperation.Clean); break; default: supported = false; break; } return(supported); }
/// <summary> /// Queries the state of a command from the standard Visual Studio 97 command set on this node. /// </summary> /// <param name="command">The command to query.</param> /// <returns>One of the <see cref="CommandStatus"/> values if the node handles the command; /// otherwise <see cref="CommandStatus.Unhandled"/>.</returns> public virtual CommandStatus QueryStandard97CommandStatus(VsCommand command) { CommandStatus status = CommandStatus.Unhandled; switch (command) { case VsCommand.Cut: case VsCommand.Copy: if (!this.IsVirtual) { status = CommandStatus.SupportedAndEnabled; } break; case VsCommand.Delete: if (this.CanDelete) { status = CommandStatus.SupportedAndEnabled; } else { status = CommandStatus.NotSupportedOrEnabled; } break; case VsCommand.NewFolder: case VsCommand.AddNewItem: case VsCommand.AddExistingItem: case VsCommand.Paste: if (this.IsFolder) { status = CommandStatus.SupportedAndEnabled; } break; case VsCommand.Open: case VsCommand.OpenWith: if (this.IsFile) { status = CommandStatus.SupportedAndEnabled; } break; case VsCommand.Rename: if (this.CaptionEditable) { status = CommandStatus.SupportedAndEnabled; } break; } return(status); }
/// <summary> /// Queries the state of a command from the standard Visual Studio 97 command set on this node. /// </summary> /// <param name="command">The command to query.</param> /// <returns>One of the <see cref="CommandStatus"/> values if the node handles the command; /// otherwise <see cref="CommandStatus.Unhandled"/>.</returns> public override CommandStatus QueryStandard97CommandStatus(VsCommand command) { if (this.Unavailable) { return(CommandStatus.Unhandled); } CommandStatus status = CommandStatus.Unhandled; switch (command) { case VsCommand.Cut: case VsCommand.Copy: case VsCommand.Delete: status = CommandStatus.NotSupportedOrEnabled; break; case VsCommand.Remove: status = CommandStatus.SupportedAndEnabled; break; case VsCommand.BuildSel: case VsCommand.BuildCtx: case VsCommand.RebuildSel: case VsCommand.RebuildCtx: case VsCommand.CleanSel: case VsCommand.CleanCtx: if (!Package.Instance.Context.IsSolutionBuilding) { status = CommandStatus.SupportedAndEnabled; } else { status = CommandStatus.Supported; } break; case VsCommand.ProjectDependencies: case VsCommand.BuildOrder: case VsCommand.ProjectSettings: status = CommandStatus.SupportedAndEnabled; break; default: status = base.QueryStandard97CommandStatus(command); break; } return(status); }
//========================================================================================== // Methods //========================================================================================== /// <summary> /// Queries the state of a command from the standard Visual Studio 97 command set on this node. /// </summary> /// <param name="command">The command to query.</param> /// <returns>One of the <see cref="CommandStatus"/> values if the node handles the command; /// otherwise <see cref="CommandStatus.Unhandled"/>.</returns> public override CommandStatus QueryStandard97CommandStatus(VsCommand command) { CommandStatus status = CommandStatus.Unhandled; switch (command) { case VsCommand.ViewCode: status = CommandStatus.SupportedAndEnabled; break; default: status = base.QueryStandard97CommandStatus(command); break; } return(status); }
//========================================================================================== // Methods //========================================================================================== /// <summary> /// Queries the state of a command from the standard Visual Studio 97 command set on this node. /// </summary> /// <param name="command">The command to query.</param> /// <returns>One of the <see cref="CommandStatus"/> values if the node handles the command; /// otherwise <see cref="CommandStatus.Unhandled"/>.</returns> public override CommandStatus QueryStandard97CommandStatus(VsCommand command) { CommandStatus status = CommandStatus.Unhandled; switch (command) { case VsCommand.ViewCode: status = CommandStatus.SupportedAndEnabled; break; default: status = base.QueryStandard97CommandStatus(command); break; } return status; }
//========================================================================================== // Methods //========================================================================================== /// <summary> /// Executes a command from the standard Visual Studio 97 command set. /// </summary> /// <param name="command">The command to execute.</param> /// <returns>true if the command is supported; otherwise, false.</returns> public override bool ExecuteStandard97Command(VsCommand command) { bool supported = true; switch (command) { case VsCommand.Remove: case VsCommand.Delete: this.RemoveFromProject(); break; default: supported = base.ExecuteStandard97Command(command); break; } return(supported); }
/// <summary> /// Queries the state of a command from the standard Visual Studio 97 command set on this node. /// </summary> /// <param name="command">The command to query.</param> /// <returns>One of the <see cref="CommandStatus"/> values if the node handles the command; /// otherwise <see cref="CommandStatus.Unhandled"/>.</returns> public override CommandStatus QueryStandard97CommandStatus(VsCommand command) { CommandStatus status = CommandStatus.Unhandled; switch (command) { case VsCommand.Open: case VsCommand.OpenWith: status = CommandStatus.NotSupportedOrEnabled; break; case VsCommand.Rename: status = CommandStatus.NotSupportedOrEnabled; break; } return(status); }
/// <summary> /// Executes a command from the standard Visual Studio 97 command set. /// </summary> /// <param name="command">The command to execute.</param> /// <returns>true if the command is supported; otherwise, false.</returns> public override bool ExecuteStandard97Command(VsCommand command) { bool supported = true; switch (command) { case VsCommand.ViewCode: this.Open(VsLogicalView.Code); break; case VsCommand.Open: this.Open(); break; default: supported = base.ExecuteStandard97Command(command); break; } return(supported); }
/// <summary> /// Executes a command from the standard Visual Studio 97 command set. /// </summary> /// <param name="command">The command to execute.</param> /// <returns>true if the command is supported; otherwise, false.</returns> public virtual bool ExecuteStandard97Command(VsCommand command) { bool supported = true; if (command != VsCommand.SolutionCfg && command != VsCommand.SearchCombo) { Tracer.Assert(true, "Put breakpoint here if you want to debug a specific menu command or find out what menu commands Visual Studio is sending."); } switch (command) { // TODO: Implement cut, copy and paste. case VsCommand.Cut: break; case VsCommand.Copy: break; case VsCommand.Paste: break; case VsCommand.Delete: this.Delete(); break; case VsCommand.Rename: this.StartNodeEdit(); break; default: supported = false; break; } return(supported); }
/// <summary> /// Executes a command from the standard Visual Studio 97 command set. /// </summary> /// <param name="command">The command to execute.</param> /// <returns>true if the command is supported; otherwise, false.</returns> public override bool ExecuteStandard97Command(VsCommand command) { bool supported = true; switch (command) { case VsCommand.ViewCode: this.Open(VsLogicalView.Code); break; case VsCommand.Open: this.Open(); break; default: supported = base.ExecuteStandard97Command(command); break; } return supported; }
/// <summary> /// Queries the state of a command from the standard Visual Studio 97 command set on this node. /// </summary> /// <param name="command">The command to query.</param> /// <returns>One of the <see cref="CommandStatus"/> values if the node handles the command; /// otherwise <see cref="CommandStatus.Unhandled"/>.</returns> public override CommandStatus QueryStandard97CommandStatus(VsCommand command) { CommandStatus status = CommandStatus.Unhandled; switch (command) { case VsCommand.Open: case VsCommand.OpenWith: status = CommandStatus.NotSupportedOrEnabled; break; case VsCommand.Rename: status = CommandStatus.NotSupportedOrEnabled; break; } return status; }
//========================================================================================== // Methods //========================================================================================== /// <summary> /// Executes a command from the standard Visual Studio 97 command set. /// </summary> /// <param name="command">The command to execute.</param> /// <returns>true if the command is supported; otherwise, false.</returns> public override bool ExecuteStandard97Command(VsCommand command) { bool supported = true; switch (command) { case VsCommand.Remove: case VsCommand.Delete: this.RemoveFromProject(); break; default: supported = base.ExecuteStandard97Command(command); break; } return supported; }
/// <summary> /// Executes a command from the standard Visual Studio 97 command set. /// </summary> /// <param name="command">The command to execute.</param> /// <returns>true if the command is supported; otherwise, false.</returns> public override bool ExecuteStandard97Command(VsCommand command) { bool supported = true; switch (command) { case VsCommand.NewFolder: { // We'll create a new folder, then immediately give the user a chance to rename it. // The code in for the Caption setter will make sure to rename the node and directory. string folderName = this.GenerateUniqueName("NewFolder", String.Empty, true); FolderNode folderNode = this.Hierarchy.CreateAndAddFolder(this, folderName); folderNode.StartNodeEdit(); break; } case VsCommand.AddNewItem: this.Hierarchy.ShowAddFileDialogBox(this, AddFileDialogType.AddNew); break; case VsCommand.AddExistingItem: this.Hierarchy.ShowAddFileDialogBox(this, AddFileDialogType.AddExisting); break; default: supported = base.ExecuteStandard97Command(command); break; } return supported; }
/// <summary> /// Queries the state of a command from the standard Visual Studio 97 command set on this node. /// </summary> /// <param name="command">The command to query.</param> /// <returns>One of the <see cref="CommandStatus"/> values if the node handles the command; /// otherwise <see cref="CommandStatus.Unhandled"/>.</returns> public override CommandStatus QueryStandard97CommandStatus(VsCommand command) { if (this.Unavailable) { return CommandStatus.Unhandled; } CommandStatus status = CommandStatus.Unhandled; switch (command) { case VsCommand.Cut: case VsCommand.Copy: case VsCommand.Delete: status = CommandStatus.NotSupportedOrEnabled; break; case VsCommand.Remove: status = CommandStatus.SupportedAndEnabled; break; case VsCommand.BuildSel: case VsCommand.BuildCtx: case VsCommand.RebuildSel: case VsCommand.RebuildCtx: case VsCommand.CleanSel: case VsCommand.CleanCtx: if (!Package.Instance.Context.IsSolutionBuilding) { status = CommandStatus.SupportedAndEnabled; } else { status = CommandStatus.Supported; } break; case VsCommand.ProjectDependencies: case VsCommand.BuildOrder: case VsCommand.ProjectSettings: status = CommandStatus.SupportedAndEnabled; break; default: status = base.QueryStandard97CommandStatus(command); break; } return status; }
/// <summary> /// Executes a command from the standard Visual Studio 97 command set. /// </summary> /// <param name="command">The command to execute.</param> /// <returns>true if the command is supported; otherwise, false.</returns> public virtual bool ExecuteStandard97Command(VsCommand command) { bool supported = true; if (command != VsCommand.SolutionCfg && command != VsCommand.SearchCombo) { Tracer.Assert(true, "Put breakpoint here if you want to debug a specific menu command or find out what menu commands Visual Studio is sending."); } switch (command) { // TODO: Implement cut, copy and paste. case VsCommand.Cut: break; case VsCommand.Copy: break; case VsCommand.Paste: break; case VsCommand.Delete: this.Delete(); break; case VsCommand.Rename: this.StartNodeEdit(); break; default: supported = false; break; } return supported; }
/// <summary> /// Queries the state of a command from the standard Visual Studio 97 command set on this node. /// </summary> /// <param name="command">The command to query.</param> /// <returns>One of the <see cref="CommandStatus"/> values if the node handles the command; /// otherwise <see cref="CommandStatus.Unhandled"/>.</returns> public virtual CommandStatus QueryStandard97CommandStatus(VsCommand command) { CommandStatus status = CommandStatus.Unhandled; switch (command) { case VsCommand.Cut: case VsCommand.Copy: if (!this.IsVirtual) { status = CommandStatus.SupportedAndEnabled; } break; case VsCommand.Delete: if (this.CanDelete) { status = CommandStatus.SupportedAndEnabled; } else { status = CommandStatus.NotSupportedOrEnabled; } break; case VsCommand.NewFolder: case VsCommand.AddNewItem: case VsCommand.AddExistingItem: case VsCommand.Paste: if (this.IsFolder) { status = CommandStatus.SupportedAndEnabled; } break; case VsCommand.Open: case VsCommand.OpenWith: if (this.IsFile) { status = CommandStatus.SupportedAndEnabled; } break; case VsCommand.Rename: if (this.CaptionEditable) { status = CommandStatus.SupportedAndEnabled; } break; } return status; }
protected virtual bool ExecuteStandard97Command(Node node, VsCommand command) { Tracer.VerifyNonNullArgument(node, "node"); // Give the node first dibs on executing the command. bool supported = node.ExecuteStandard97Command(command); Tracer.WriteLineIf(classType, "ExecuteStandard97Command", Tracer.Level.Verbose, !supported, "Not executing the command '{0}'", command); return supported; }
/// <summary> /// Executes a command from the standard Visual Studio 97 command set. /// </summary> /// <param name="command">The command to execute.</param> /// <returns>true if the command is supported; otherwise, false.</returns> public override bool ExecuteStandard97Command(VsCommand command) { bool supported = true; switch (command) { case VsCommand.BuildCtx: case VsCommand.BuildSel: this.Hierarchy.AttachedProject.StartBuild(BuildOperation.Build); break; case VsCommand.RebuildCtx: case VsCommand.RebuildSel: this.Hierarchy.AttachedProject.StartBuild(BuildOperation.Rebuild); break; case VsCommand.CleanCtx: case VsCommand.CleanSel: this.Hierarchy.AttachedProject.StartBuild(BuildOperation.Clean); break; default: supported = false; break; } return supported; }