/// <summary> /// Executes a specified command, potentially based on parameters passed in /// from the data view support XML. /// </summary> /// <param name="itemIds"> /// Array of identifiers for the items in the data view hierarchy on which this /// command should be invoked. /// </param> /// <param name="command"> /// The OleCommand object representing the command to invoke. /// </param> /// <param name="executionOption"> /// Any OleCommandExecutionOption object instance representing options on the /// invoked command. /// NOT USED. /// </param> /// <param name="arguments"> /// An object representing arguments to the command. /// NOT USED. /// </param> /// <returns> /// Returns an object instance representing the value returned by the specified /// command, which is typically nothing. /// </returns> public override object[] ExecuteCommand(int[] itemIds, OleCommand command, OleCommandExecutionOption executionOption, object arguments) { if (command == null) { throw new ArgumentNullException("command"); } if (!HandleStaticCommand(command.CommandId)) { BaseNode node = MakeNewNode(itemIds[0]); node.ExecuteCommand(command.CommandId); } return(null); }
/// <summary> /// Executes a specified command, potentially based on parameters passed in /// from the data view support XML. /// </summary> /// <param name="itemIds"> /// Array of identifiers for the items in the data view hierarchy on which this /// command should be invoked. /// </param> /// <param name="command"> /// The OleCommand object representing the command to invoke. /// </param> /// <param name="executionOption"> /// Any OleCommandExecutionOption object instance representing options on the /// invoked command. /// NOT USED. /// </param> /// <param name="arguments"> /// An object representing arguments to the command. /// NOT USED. /// </param> /// <returns> /// Returns an object instance representing the value returned by the specified /// command, which is typically nothing. /// </returns> public override object[] ExecuteCommand( int[] itemIds, OleCommand command, OleCommandExecutionOption executionOption, object arguments) { if (command == null) { throw new ArgumentNullException("command"); } // Get command handler instance ICommand commandHandler = CommandFactory.Instance.CreateCommandHandler(command.GroupGuid, command.CommandId); if (commandHandler == null) { return(base.ExecuteCommand(itemIds, command, executionOption, arguments)); } // Executes command return(commandHandler.Execute(Hierarchy, itemIds)); }
/// <summary> /// Executes a specified command, potentially based on parameters passed in /// from the data view support XML. /// </summary> /// <param name="itemId"> /// Identifier of hierarchy item for which command should be executed. /// </param> /// <param name="command"> /// The OleCommand object representing the command to invoke. /// </param> /// <param name="executionOption"> /// Any OleCommandExecutionOption object instance representing options on the /// invoked command. /// NOT USED. /// </param> /// <param name="arguments"> /// An object representing arguments to the command. /// NOT USED. /// </param> /// <returns> /// Returns an object instance representing the value returned by the specified /// command, which is typically nothing. /// </returns> public override object ExecuteCommand(int itemId, OleCommand command, OleCommandExecutionOption executionOption, object arguments) { return ExecuteCommand(new int[] { itemId }, command, executionOption, arguments); }
/// <summary> /// Executes a specified command, potentially based on parameters passed in /// from the data view support XML. /// </summary> /// <param name="itemIds"> /// Array of identifiers for the items in the data view hierarchy on which this /// command should be invoked. /// </param> /// <param name="command"> /// The OleCommand object representing the command to invoke. /// </param> /// <param name="executionOption"> /// Any OleCommandExecutionOption object instance representing options on the /// invoked command. /// NOT USED. /// </param> /// <param name="arguments"> /// An object representing arguments to the command. /// NOT USED. /// </param> /// <returns> /// Returns an object instance representing the value returned by the specified /// command, which is typically nothing. /// </returns> public override object[] ExecuteCommand( int[] itemIds, OleCommand command, OleCommandExecutionOption executionOption, object arguments) { if (command == null) throw new ArgumentNullException("command"); // Get command handler instance ICommand commandHandler = CommandFactory.Instance.CreateCommandHandler(command.GroupGuid, command.CommandId); if (commandHandler == null) return base.ExecuteCommand(itemIds, command, executionOption, arguments); // Executes command return commandHandler.Execute(Hierarchy, itemIds); }
/// <summary> /// Executes a specified command, potentially based on parameters passed in /// from the data view support XML. /// </summary> /// <param name="itemIds"> /// Array of identifiers for the items in the data view hierarchy on which this /// command should be invoked. /// </param> /// <param name="command"> /// The OleCommand object representing the command to invoke. /// </param> /// <param name="executionOption"> /// Any OleCommandExecutionOption object instance representing options on the /// invoked command. /// NOT USED. /// </param> /// <param name="arguments"> /// An object representing arguments to the command. /// NOT USED. /// </param> /// <returns> /// Returns an object instance representing the value returned by the specified /// command, which is typically nothing. /// </returns> public override object[] ExecuteCommand(int[] itemIds, OleCommand command, OleCommandExecutionOption executionOption, object arguments) { if (command == null) throw new ArgumentNullException("command"); if (!HandleStaticCommand(command.CommandId)) { BaseNode node = MakeNewNode(itemIds[0]); node.ExecuteCommand(command.CommandId); } return null; }
/// <summary> /// This method executes a specified command, potentially based /// on parameters passed in from the data view support XML. /// </summary> public override object ExecuteCommand(int itemId, OleCommand command, OleCommandExecutionOption executionOption, object arguments) { object returnValue = null; object[] args = arguments as object[]; if (command.GroupGuid == guidSQLiteCmdSet) { switch ((cmdid)command.CommandId) { case cmdid.Vacuum: Vacuum(); break; case cmdid.Rekey: ChangePassword(itemId); break; default: returnValue = base.ExecuteCommand(itemId, command, executionOption, arguments); break; } } else if (command.GroupGuid == VSConstants.GUID_VSStandardCommandSet97) { switch ((VSConstants.VSStd97CmdID)command.CommandId) { case VSConstants.VSStd97CmdID.Delete: switch ((string)args[0]) { case "Table": DropSelectedTables(); break; case "Index": DropSelectedIndexes(); break; case "View": DropSelectedViews(); break; } break; } } else if (command.GroupGuid == guidDataCmdSet) { switch ((cmdid)command.CommandId) { case cmdid.CreateTable: DesignTable(itemId, null); break; case cmdid.CreateView: DesignView(itemId, null); break; case cmdid.Alter: switch ((string)args[0]) { case "Table": { object[] parts; int[] items = DataViewHierarchyAccessor.GetSelectedItems(); parts = DataViewHierarchyAccessor.GetObjectIdentifier(items[0]); DesignTable(itemId, parts[2].ToString()); } break; case "Index": break; case "View": { object[] parts; int[] items = DataViewHierarchyAccessor.GetSelectedItems(); parts = DataViewHierarchyAccessor.GetObjectIdentifier(items[0]); DesignView(itemId, parts[2].ToString()); } break; } break; } } else { returnValue = base.ExecuteCommand(itemId, command, executionOption, arguments); } return returnValue; }
public override object[] ExecuteCommand(int[] itemIds, OleCommand command, OleCommandExecutionOption executionOption, object arguments) { return base.ExecuteCommand(itemIds, command, executionOption, arguments); }
/// <summary> /// This method executes a specified command, potentially based /// on parameters passed in from the data view support XML. /// </summary> public override object ExecuteCommand(int itemId, OleCommand command, OleCommandExecutionOption executionOption, object arguments) { object returnValue = null; object[] args = arguments as object[]; if (command.GroupGuid == guidSQLiteCmdSet) { switch ((cmdid)command.CommandId) { case cmdid.Vacuum: Vacuum(); break; case cmdid.Rekey: ChangePassword(itemId); break; default: returnValue = base.ExecuteCommand(itemId, command, executionOption, arguments); break; } } else if (command.GroupGuid == VSConstants.GUID_VSStandardCommandSet97) { switch ((VSConstants.VSStd97CmdID)command.CommandId) { case VSConstants.VSStd97CmdID.Delete: switch ((string)args[0]) { case "Table": DropSelectedTables(); break; case "Index": DropSelectedIndexes(); break; case "View": DropSelectedViews(); break; } break; } } else if (command.GroupGuid == guidDataCmdSet) { switch ((cmdid)command.CommandId) { case cmdid.CreateTable: DesignTable(itemId, null); break; case cmdid.CreateView: DesignView(itemId, null); break; case cmdid.Alter: switch ((string)args[0]) { case "Table": { object[] parts; int[] items = DataViewHierarchyAccessor.GetSelectedItems(); parts = DataViewHierarchyAccessor.GetObjectIdentifier(items[0]); DesignTable(itemId, parts[2].ToString()); } break; case "Index": break; case "View": { object[] parts; int[] items = DataViewHierarchyAccessor.GetSelectedItems(); parts = DataViewHierarchyAccessor.GetObjectIdentifier(items[0]); DesignView(itemId, parts[2].ToString()); } break; } break; } } else { returnValue = base.ExecuteCommand(itemId, command, executionOption, arguments); } return(returnValue); }
public override object[] ExecuteCommand(int[] itemIds, OleCommand command, OleCommandExecutionOption executionOption, object arguments) { return(base.ExecuteCommand(itemIds, command, executionOption, arguments)); }
/// <summary> /// Executes a specified command, potentially based on parameters passed in /// from the data view support XML. /// </summary> /// <param name="itemId"> /// Identifier of hierarchy item for which command should be executed. /// </param> /// <param name="command"> /// The OleCommand object representing the command to invoke. /// </param> /// <param name="executionOption"> /// Any OleCommandExecutionOption object instance representing options on the /// invoked command. /// NOT USED. /// </param> /// <param name="arguments"> /// An object representing arguments to the command. /// NOT USED. /// </param> /// <returns> /// Returns an object instance representing the value returned by the specified /// command, which is typically nothing. /// </returns> public override object ExecuteCommand(int itemId, OleCommand command, OleCommandExecutionOption executionOption, object arguments) { return(ExecuteCommand(new int[] { itemId }, command, executionOption, arguments)); }