• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CommandAction类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CommandAction的典型用法代码示例。如果您正苦于以下问题:C# CommandAction类的具体用法?C# CommandAction怎么用?C# CommandAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CommandAction类属于命名空间,在下文中一共展示了CommandAction类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ExecuteParams

 public ExecuteParams(CommandAction action, string projectName, string solutionName, string assemblyName, string projectOutput)
 {
     _action = action;
     _projectName = projectName;
     _solutionName = solutionName;
     _assemblyName = assemblyName;
     _projectOutput = projectOutput;
 }
开发者ID:vebin,项目名称:LINQBridgeVs,代码行数:8,代码来源:BridgeTrigger.cs


示例2: CommandResponse

 public CommandResponse(CommandAction botAction)
 {
     Action = botAction;
 }
开发者ID:jrmitch120,项目名称:WarlightAiBot,代码行数:4,代码来源:CommandResponse.cs


示例3: BuildTarget

        private void BuildTarget(Dictionary<string, ITask> targets, string targetName, CommandAction commandAction)
        {
            ITask task = FindTarget(targets, targetName);

            using (ITaskScope targetScope = _bounce.TaskScope(task, commandAction.Command, targetName)) {
                commandAction.Action(task);
                targetScope.TaskSucceeded();
            }
        }
开发者ID:svoruganti,项目名称:bounce,代码行数:9,代码来源:BounceRunner.cs


示例4: SetCommandInternal

		private DbCommand SetCommandInternal(CommandAction cmdAction, CommandType cmdType, string cmdText, DbParameter[] cmdParameters, bool autoPrepareCommand)
		{
			DbCommand command = this.GetCommand(cmdAction);

			command.Parameters.Clear();
			command.CommandType = cmdType;

			command.CommandText = this.PretreatmentCommandText(cmdText);

			switch (cmdAction)
			{
				case CommandAction.Select:
					_selectCommandParameters = cmdParameters;
					if (this._adapter != null)
					{
						this._adapter.Dispose();
						this._adapter = null;
					}
					if (this._builder != null)
					{
						this._builder.Dispose();
						this._builder = null;
					}
					break;
				case CommandAction.Insert:
					_insertCommandParameters = cmdParameters;
					if (this._adapter != null)
					{
						this._adapter.InsertCommand = command;
					}
					break;
				case CommandAction.Update:
					_updateCommandParameters = cmdParameters;
					if (this._adapter != null)
					{
						this._adapter.UpdateCommand = command;
					}
					break;
				case CommandAction.Delete:
					_deleteCommandParameters = cmdParameters;
					if (this._adapter != null)
					{
						this._adapter.DeleteCommand = command;
					}
					break;
				default:
					break;
			}
			if (cmdParameters != null)
			{
				for (int i = 0; i < cmdParameters.Length; i++)
				{
					command.Parameters.Add(cmdParameters[i]);
				}
			}
			if (autoPrepareCommand)
			{
				command.Prepare();
			}
			return command;
		}
开发者ID:Kjubo,项目名称:xms.core,代码行数:61,代码来源:DataTableAdapter.cs


示例5: RegisterCommand

 public static void RegisterCommand(CommandAction<float, float> action)
 {
     CRegistery.RegisterDelegate(action);
 }
开发者ID:mswf,项目名称:game-a-week,代码行数:4,代码来源:Lunar.cs


示例6: GetCommandName

 /// <summary>
 /// 获取命令名称。
 /// </summary>
 /// <param name="action">命令动作。</param>
 /// <param name="name">命令名称。</param>
 /// <returns>命令名称。</returns>
 public static string GetCommandName(CommandAction action, string name)
 {
     return (action == CommandAction.None ? name : string.Format("{0}-{1}", action, name)).Trim();
 }
开发者ID:l1183479157,项目名称:RabbitHub,代码行数:10,代码来源:CommandHelper.cs


示例7: CommandAttribute

 /// <summary>
 /// 初始化一个新的命令标记。
 /// </summary>
 /// <param name="commandAction">命令动作。</param>
 /// <param name="commandName">命令名称。</param>
 /// <param name="description">命令说明。</param>
 public CommandAttribute(CommandAction commandAction, string commandName, string description)
     : this(commandName)
 {
     Action = commandAction;
     Description = description.NotEmptyOrWhiteSpace("description");
 }
开发者ID:l1183479157,项目名称:RabbitHub,代码行数:12,代码来源:CommandAttribute.cs


示例8: QueueCommand

 // Queue a command to be invoked as soon as possible
 public static void QueueCommand(CommandAction command) {
     if (Instance != null) Instance.Commands.Add(command);
 }
开发者ID:gato0429,项目名称:GlobalGame2016,代码行数:4,代码来源:SceneManager.cs


示例9: Target

 // Notify of a new action request
 private void Target(ActionRequest request) {
     var command = new CommandAction() {
         Entities = Selected.ToArray(),
         Request = request,
     };
     SceneManager.QueueCommand(command);
 }
开发者ID:gato0429,项目名称:GlobalGame2016,代码行数:8,代码来源:SelectionManager.cs


示例10: GetStatus

 private CommandStates GetStatus(CommandAction action)
 {
     return GetCommandStatus(GetMultiStatus(), action);
 }
开发者ID:EdsonF,项目名称:LINQBridgeVs,代码行数:4,代码来源:LINQBridgeExtension.cs


示例11: CommandLineParseException

 public CommandLineParseException(string parserMessage, CommandAction action)
 {
     _parserMessage = parserMessage;
     _action = action;
 }
开发者ID:surgicalcoder,项目名称:synoptic,代码行数:5,代码来源:CommandLineParseException.cs


示例12: RegisterCommand

        public void RegisterCommand(string commandTag, string description, CommandAction callback)
        {
            string lowerCommand = commandTag.ToLower();
            if (commandTable.ContainsKey(lowerCommand))
            {
                throw new InvalidOperationException(
                    String.Format("Command \"{0}\" is already registered.", commandTag));
            }

            commandTable.Add(lowerCommand, new CommandInfo(commandTag, description, callback));
        }
开发者ID:lancelot2112,项目名称:XerUtilities,代码行数:11,代码来源:Console.cs


示例13: CommandInfo

 public CommandInfo(string commandTag, string description, CommandAction action)
 {
     this.Command = commandTag;
     this.Description = description;
     this.Callback = action;
 }
开发者ID:lancelot2112,项目名称:XerUtilities,代码行数:6,代码来源:Console.cs


示例14: AddOnce

 public void AddOnce(CommandAction action)
 {
     onceMethods.Add(action);
 }
开发者ID:jpennell,项目名称:miranda,代码行数:4,代码来源:Signal.cs


示例15: Execute

        public void Execute(CommandAction action)
        {
            if (SelectedProject == null)
                return;

            BridgeTrigger.Execute(new BridgeTrigger.ExecuteParams(action, SelectedProject.FullName, SolutionName, SelectedAssemblyName, SelectedProjectOutputPath));
        }
开发者ID:vebin,项目名称:LINQBridgeVs,代码行数:7,代码来源:LINQBridgeExtension.cs


示例16: GetCommand

		private DbCommand GetCommand(CommandAction commandAction)
		{
			switch (commandAction)
			{
				case CommandAction.Insert:
					if (this._insertCommand == null)
					{
						this._insertCommand = this.CreateCommand();
					}
					return this._insertCommand;
				case CommandAction.Update:
					if (this._updateCommand == null)
					{
						this._updateCommand = this.CreateCommand();
					}
					return this._updateCommand;
				case CommandAction.Delete:
					if (this._deleteCommand == null)
					{
						this._deleteCommand = this.CreateCommand();
					}
					return this._deleteCommand;
				case CommandAction.Select:
					if (this._selectCommand == null)
					{
						this._selectCommand = this.CreateCommand();
					}
					return this._selectCommand;
				default:
					return this.CreateCommand();
			}
		}
开发者ID:Kjubo,项目名称:xms.core,代码行数:32,代码来源:DataTableAdapter.cs


示例17: Execute

        public void Execute(CommandAction action)
        {
            if (SelectedProject == null)
                return;

            var allProjectReferences = Crawler.FindProjectDependencies(SelectedProject.FullName, SolutionName);
            var foundProjects = allProjectReferences as IList<Dependency.Project> ?? allProjectReferences.ToList();
            var projectReferences = foundProjects.Where(project => project.DependencyType == DependencyType.ProjectReference);
            // var assemblyReferences = allProjectReferences.Where(project => project.DependencyType == DependencyType.AssemblyReference);

            var references = projectReferences as IList<Dependency.Project> ?? projectReferences.ToList();
            switch (action)
            {
                case CommandAction.Enable:
                    const string enableMessage = "Following project dependencies have been found...LINQBridge them? (Recommended)";
                    PackageConfigurator.EnableProject(SelectedProjectOutputPath, SelectedAssemblyName, SolutionName);
                    var enabledDependencies = new List<string>();
                    enabledDependencies.Insert(0, SelectedAssemblyName);

                    if (references.Any(project => PackageConfigurator.IsBridgeDisabled(project.AssemblyName, SolutionName)))
                    {
                        var projectDependencies = new ProjectDependencies(references, enableMessage);
                        var dependencies = projectDependencies.ShowDependencies(PackageConfigurator.EnableProject);
                        enabledDependencies.AddRange(dependencies.Select(project => project.AssemblyName));
                    }

                    MessageBox.Show(string.Format("LINQBridge on {0} has been Enabled...", string.Join(", ", enabledDependencies)), "Success", MessageBoxButtons.OK);

                    break;
                case CommandAction.Disable:
                    const string disableMessage = "Following project dependencies have been found...Un-LINQBridge them? (Recommended)";

                    PackageConfigurator.DisableProject(SelectedProjectOutputPath, SelectedAssemblyName, SolutionName);
                    var disableDependencies = new List<string>();
                    disableDependencies.Insert(0, SelectedAssemblyName);

                    if (references.Any(project => PackageConfigurator.IsBridgeEnabled(project.AssemblyName, SolutionName)))
                    {
                        var projectDependencies = new ProjectDependencies(references, disableMessage);
                        var dependencies = projectDependencies.ShowDependencies(PackageConfigurator.DisableProject);
                        disableDependencies.AddRange(dependencies.Select(project => project.AssemblyName));
                    }

                    MessageBox.Show(string.Format("LINQBridge on {0} has been Disabled...", string.Join(", ", disableDependencies)), "Success", MessageBoxButtons.OK);

                    break;
                default:
                    throw new ArgumentOutOfRangeException("action");
            }
        }
开发者ID:EdsonF,项目名称:LINQBridgeVs,代码行数:50,代码来源:LINQBridgeExtension.cs


示例18: SetCommand

		private DataTableAdapter SetCommand(CommandAction cmdAction, CommandType cmdType, string cmdText, DbParameter[] cmdParameters, bool autoPrepareCommand)
		{
			this.SetCommandInternal(cmdAction, cmdType, cmdText, cmdParameters, autoPrepareCommand);

			return this;
		}
开发者ID:Kjubo,项目名称:xms.core,代码行数:6,代码来源:DataTableAdapter.cs


示例19: UpdateCommand

 public void UpdateCommand(MenuCommand cmd, CommandAction action)
 {
     var states = GetStatus(action);
     cmd.Visible = (CommandStates.Visible & states) != 0;
     cmd.Enabled = (CommandStates.Enabled & states) != 0;
 }
开发者ID:EdsonF,项目名称:LINQBridgeVs,代码行数:6,代码来源:LINQBridgeExtension.cs


示例20: Act

 public static Command Act(CommandAction action)
 {
     return new Command { Action = action, Time = 1 };
 }
开发者ID:DmitryZyr,项目名称:CVARC,代码行数:4,代码来源:Command.cs



注:本文中的CommandAction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CommandArgs类代码示例发布时间:2022-05-24
下一篇:
C# Command类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap