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

C# Commands类代码示例

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

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



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

示例1: OnCommandCanceled

        internal void OnCommandCanceled(Commands.BaseCommand command, string reason)
        {
            if (!m_sendNotifications)
            {
                return;
            }

            var castSpell = command as Commands.CastSpell;
            if (castSpell != null)
            {
                new Interactions.NotifySpellEvent(Game, "OnSpellCastCanceled", castSpell.Spell as Behaviors.ICastableSpell, reason).Run();
            }

            var moveCard = command as Commands.InitiativeMoveCard;
            if (moveCard != null && moveCard.FromZone == SystemZone.Hand && moveCard.ToZone == SystemZone.Battlefield
                && moveCard.Cause is Game)
            {
                new Interactions.NotifyCardEvent(Game, "OnCardPlayCanceled", moveCard.Subject, reason).Run();
            }

            if (command is Commands.IInitiativeCommand)
            {
                new Interactions.NotifyGameEvent(Game, "OnInitiativeCommandCanceled", null).Run();
            }
        }
开发者ID:galaxyyao,项目名称:TouhouGrave,代码行数:25,代码来源:BaseController.CommandTriggers.cs


示例2: QueueCommand

        internal void QueueCommand(Commands.BaseCommand command)
        {
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }

            // check whether a new command can be queued at this timing
            if (RunningCommand != null)
            {
                Debug.Assert(RunningCommand.ExecutionPhase != Commands.CommandPhase.Pending);

                if (RunningCommand.ExecutionPhase == Commands.CommandPhase.Prerequisite)
                {
                    throw new InvalidOperationException("Command can't be queued in Prerequisite phase.");
                }
            }

            InitializeCommand(command);
            command.ValidateOnIssue();

            if (RunningCommand != null && RunningCommand.ExecutionPhase == Commands.CommandPhase.Prolog)
            {
                Debug.Assert(m_timingGroupHead != null && m_timingGroupTail != null);
                command.Next = m_timingGroupTail.Next;
                m_timingGroupTail.Next = command;
                m_timingGroupTail = command;
            }
            else
            {
                CommandQueue.PushTail(command, ref m_commandQueueHead, ref m_commandQueueTail);
            }
        }
开发者ID:galaxyyao,项目名称:TouhouGrave,代码行数:33,代码来源:ResolveContext.CommandQueue.cs


示例3: RegisterAll

        public static void RegisterAll(Commands system)
        {
            // Entity Events
            system.RegisterEvent(new AnimalDamagedScriptEvent(system));
            system.RegisterEvent(new AnimalDeathScriptEvent(system));
            system.RegisterEvent(new BarricadeDamagedScriptEvent(system));
            system.RegisterEvent(new BarricadeDestroyedScriptEvent(system));
            system.RegisterEvent(new EntityDamagedScriptEvent(system));
            system.RegisterEvent(new EntityDeathScriptEvent(system));
            system.RegisterEvent(new EntityDestroyedScriptEvent(system));
            system.RegisterEvent(new ResourceDamagedScriptEvent(system));
            system.RegisterEvent(new ResourceDestroyedScriptEvent(system));
            system.RegisterEvent(new StructureDamagedScriptEvent(system));
            system.RegisterEvent(new StructureDestroyedScriptEvent(system));
            system.RegisterEvent(new VehicleDamagedScriptEvent(system));
            system.RegisterEvent(new VehicleDestroyedScriptEvent(system));
            system.RegisterEvent(new ZombieDamagedScriptEvent(system));
            system.RegisterEvent(new ZombieDeathScriptEvent(system));

            // Player Events
            system.RegisterEvent(new PlayerChatScriptEvent(system));
            system.RegisterEvent(new PlayerConnectingScriptEvent(system));
            system.RegisterEvent(new PlayerConnectedScriptEvent(system));
            system.RegisterEvent(new PlayerDamagedScriptEvent(system));
            system.RegisterEvent(new PlayerDeathScriptEvent(system));
            system.RegisterEvent(new PlayerDisconnectedScriptEvent(system));
            system.RegisterEvent(new PlayerShootScriptEvent(system));
        }
开发者ID:FreneticXYZ,项目名称:UnturnedFrenetic,代码行数:28,代码来源:UnturnedFreneticEvents.cs


示例4: sendData

 public void sendData(Commands cmd)
 {
     if (port.IsOpen)
     {
         port.Write(new byte[] { (byte)cmd }, 0, 1);
     }
 }
开发者ID:EmirhanPala,项目名称:led-tachometer-microcontroller,代码行数:7,代码来源:Tachometer.cs


示例5: Send

        public async Task<Response> Send(Commands.Command command)
        {
            
            int id = commandsSent;
            var mes = command.GetMessage(id);
            commandsSent++;
            bool hasResponse = false;
            if (socket.State != WebSocketState.Open)
            {
                if (socket.State == WebSocketState.None || socket.State == WebSocketState.Closed)
                {
                    socket.Open();
                    while (socket.State == WebSocketState.Connecting)
                        await Task.Delay(100);

                    if (socket.State != WebSocketState.Open)
                        throw new Exception("Socket could not be opened.");
                }
            }
            socket.Send(mes);
            while (!hasResponse)
            {
                await Task.Delay(10).ConfigureAwait(false);
                lock (responses)
                {
                    hasResponse = responses.ContainsKey(id);
                }
            }
            var response = responses[id];
            removeResponse(id);
            return response;
        }
开发者ID:RichTeaMan,项目名称:RemoteDebugger,代码行数:32,代码来源:RemoteDebugger.cs


示例6: CreateNavigationCommands

        void CreateNavigationCommands(Commands commands)
        {
            var previousCmd = commands.AddNamedCommand(
                m_addIn,
                "GotoPrevious",
                "goto previous location",
                "Goto the previous location in the current navigation list.",
                false,
                0,
                vsCommandDisabledFlagsValue:
                    (int) vsCommandStatus.vsCommandStatusEnabled 
                    | (int) vsCommandStatus.vsCommandStatusSupported
            );

            previousCmd.Bindings = "Global::Alt+Left Arrow";
            
            var nextCmd = commands.AddNamedCommand(
                m_addIn,
                "GotoNext",
                "goto next location",
                "Goto the next location in the current navigation list.",
                false,
                0,
                vsCommandDisabledFlagsValue:
                    (int) vsCommandStatus.vsCommandStatusEnabled 
                    | (int) vsCommandStatus.vsCommandStatusSupported
            );

            nextCmd.Bindings = "Global::Alt+Right Arrow";
        }
开发者ID:scottwis,项目名称:scottwis.visualstudio,代码行数:30,代码来源:VisualStudio.cs


示例7: Query

 /// <summary>
 /// Simple constructor that initializes all
 /// the fields.
 /// </summary>
 /// <param name="command"></param>
 /// <param name="key"></param>
 /// <param name="argument"></param>
 public Query(Commands command, string key, string argument)
 {
     this.Command = command;
     this.Key = key;
     this.Argument = argument;
     ExecutionDate = DateTime.Now;
 }
开发者ID:SamuelCox,项目名称:Noise,代码行数:14,代码来源:Query.cs


示例8: AudioChangedEventArgs

 public AudioChangedEventArgs(Commands command, string audioFile, double? leftVolume = null, double? rightVolume = null)
 {
     this.Command = command;
     this.AudioFile = audioFile;
     this.LeftVolume = leftVolume;
     this.RightVolume = rightVolume;
 }
开发者ID:HakanL,项目名称:animatroller,代码行数:7,代码来源:AudioChanged.cs


示例9: RunCommand

 private void RunCommand(Commands cmd)
 {
     if (CurrentNode.DataItem is ProjectFile) {
         ProjectFile file = (ProjectFile)CurrentNode.DataItem;
         Project prj = file.Project;
         ProjectFileCollection pfc = prj.Files;
         int currIndex = pfc.IndexOf(file);
         try {
             switch (cmd) {
                 case Commands.MoveUp:
                     if (currIndex > 0) {
                         pfc.RemoveAt(currIndex);
                         pfc.Insert(currIndex-1, file);
                     }
                     break;
                 case Commands.MoveDown:
                     if (currIndex < pfc.Count-1 ) {
                         pfc.RemoveAt(currIndex);
                         pfc.Insert(currIndex+1, file);
                     }
                     break;
                 }
             using (IProgressMonitor monitor = GetStatusMonitor()){
                 prj.Save(monitor);
             }
         }
         catch (Exception ex) {
             LoggingService.LogError (ex.ToString ());
         }
     }
 }
开发者ID:mikkom,项目名称:fsharpbinding,代码行数:31,代码来源:FSharpBindingNodeExtension.cs


示例10: BinaryPacketFormatter

        public BinaryPacketFormatter(Commands command, params object[] args)
            : this()
        {
            this.Add(command);
            foreach (var obj in args)
            {
                if (obj is Byte) this.Add((Byte)obj);

                if (obj is Int16) this.Add((Int16)obj);
                if (obj is UInt16) this.Add((UInt16)obj);

                if (obj is Int32) this.Add((Int32)obj);
                if (obj is UInt32) this.Add((UInt32)obj);

                if (obj is Int64) this.Add((Int64)obj);
                if (obj is UInt64) this.Add((UInt64)obj);

                if (obj is byte[]) this.Add((byte[])obj);
                if (obj is List<byte>) this.Add((List<byte>)obj);
                if (obj is string) this.Add((string)obj);
                if (obj is float) this.Add((float)obj);
                if (obj is Vector3) this.Add((Vector3)obj);
                if (obj is Vector4) this.Add((Vector4)obj);
                if (obj is Quaternion) this.Add((Quaternion)obj);
            }
        }
开发者ID:andrefsantos,项目名称:gta-iv-multiplayer,代码行数:26,代码来源:BinaryPacketFormatter.cs


示例11: Create

        public static Usuario Create(Commands.NovoUsuarioCompletoCommand cmd)
        {
            var telefone = new AparelhoTelefone(cmd.Numero, cmd.UUID, cmd.SistemaOperacional);
            var usuarioCompleto = new Usuario(cmd.Nome, cmd.Email, cmd.AceitoMkt, telefone);

            return usuarioCompleto;
        }
开发者ID:TicketArchitecture,项目名称:Api-Template,代码行数:7,代码来源:UsuarioCompletoFactory.cs


示例12: Delete

        public ActionResult Delete(Commands.DeleteUserCommand command)
        {
            var service = new Commanding.SimpleTwitterCommandServiceClient();
            service.DeleteUser(command);

            return RedirectToAction("Index");
        }
开发者ID:phillipknauss,项目名称:CqrsSiteEngine,代码行数:7,代码来源:UserController.cs


示例13: ParseCommand

        private static void ParseCommand(string str, out Commands command, out Range range)
        {
            const string turnOffStr = "turn off";
            const string turnOnStr = "turn on";
            const string toggleStr = "toggle";
            if (str.StartsWith(turnOffStr))
            {
                command = Commands.TurnOff;
            }
            else if (str.StartsWith(turnOnStr))
            {
                command = Commands.TurnOn;
            }
            else if (str.StartsWith(toggleStr))
            {
                command = Commands.Toggle;
            }
            else
            {
                throw new ArgumentException("unknown command");
            }

            var regex = new Regex(@"(\d+)\,(\d+)");
            var matches = regex.Matches(str);
            var x1 = int.Parse(matches[0].Groups[1].Value);
            var y1 = int.Parse(matches[0].Groups[2].Value);
            var x2 = int.Parse(matches[1].Groups[1].Value);
            var y2 = int.Parse(matches[1].Groups[2].Value);
            range = new Range(new Point(x1, y1), new Point(x2, y2));
        }
开发者ID:navoznov,项目名称:AdventOfCode,代码行数:30,代码来源:Program.cs


示例14: BuildCommandsXls

        //xls���ǂݍ��ݎ�
        public void BuildCommandsXls(string xlsSchemaFile)
        {
            NDbUnit.Core.CreateXlsDs createXls = CreateXlsDs.GetInstance();
            //_dataSet.ReadXmlSchema(xmlSchema);
            // DataSet table rows RowState property is set to Added
            // when read in from an xml file.
            //_dataSet.AcceptChanges();

            _dataSet = createXls.CreateDataSetToXls(xlsSchemaFile);

            Hashtable ht = new Hashtable();

            Commands commands;
            foreach (DataTable dataTable in _dataSet.Tables)
            {
                // Virtual overrides.
                commands = new Commands();
                commands.SelectCommand = CreateSelectCommand(_dataSet, dataTable.TableName);
                commands.InsertCommand = CreateInsertCommand(commands.SelectCommand, dataTable.TableName);
                commands.InsertIdentityCommand = CreateInsertIdentityCommand(commands.SelectCommand, dataTable.TableName);
                commands.DeleteCommand = CreateDeleteCommand(commands.SelectCommand, dataTable.TableName);
                commands.DeleteAllCommand = CreateDeleteAllCommand(dataTable.TableName);
                commands.UpdateCommand = CreateUpdateCommand(commands.SelectCommand, dataTable.TableName);

                ht[dataTable.TableName] = commands;
            }

            _dbCommandColl = ht;
            _initialized = true;
        }
开发者ID:GCnaoto,项目名称:NDBUnit_add_ReadXls,代码行数:31,代码来源:DbCommandBuilder2.cs


示例15: Init

        /// <summary>
        /// Prepares the command system, registering all base commands.
        /// </summary>
        public void Init(Outputter _output, Client tclient)
        {
            // General Init
            TheClient = tclient;
            CommandSystem = new Commands();
            Output = _output;
            CommandSystem.Output = Output;
            CommandSystem.Init();

            // UI Commands
            CommandSystem.RegisterCommand(new AttackCommand(TheClient));
            CommandSystem.RegisterCommand(new BackwardCommand(TheClient));
            CommandSystem.RegisterCommand(new BindblockCommand(TheClient));
            CommandSystem.RegisterCommand(new BindCommand(TheClient));
            CommandSystem.RegisterCommand(new ForwardCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemdownCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemleftCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemrightCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemupCommand(TheClient));
            CommandSystem.RegisterCommand(new LeftwardCommand(TheClient));
            CommandSystem.RegisterCommand(new MovedownCommand(TheClient));
            CommandSystem.RegisterCommand(new RightwardCommand(TheClient));
            CommandSystem.RegisterCommand(new SecondaryCommand(TheClient));
            CommandSystem.RegisterCommand(new SprintCommand(TheClient));
            CommandSystem.RegisterCommand(new TalkCommand(TheClient));
            CommandSystem.RegisterCommand(new UnbindCommand(TheClient));
            CommandSystem.RegisterCommand(new UpwardCommand(TheClient));
            CommandSystem.RegisterCommand(new UseCommand(TheClient));
            CommandSystem.RegisterCommand(new WalkCommand(TheClient));

            // Common Commands
            CommandSystem.RegisterCommand(new CdevelCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemnextCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemprevCommand(TheClient));
            CommandSystem.RegisterCommand(new ItemselCommand(TheClient));
            CommandSystem.RegisterCommand(new PlayCommand(TheClient));
            CommandSystem.RegisterCommand(new QuickItemCommand(TheClient));
            CommandSystem.RegisterCommand(new QuitCommand(TheClient));
            CommandSystem.RegisterCommand(new ReloadGameCommand(TheClient));

            // Network Commands
            CommandSystem.RegisterCommand(new ConnectCommand(TheClient));
            CommandSystem.RegisterCommand(new DisconnectCommand(TheClient));
            CommandSystem.RegisterCommand(new NetusageCommand(TheClient));
            CommandSystem.RegisterCommand(new PingCommand(TheClient));
            CommandSystem.RegisterCommand(new StartlocalserverCommand(TheClient));

            // Game Commands
            CommandSystem.RegisterCommand(new InventoryCommand(TheClient));
            CommandSystem.RegisterCommand(new TesteffectCommand(TheClient));

            // General Tags
            CommandSystem.TagSystem.Register(new AudioTagBase(TheClient));

            // Entity Tags
            CommandSystem.TagSystem.Register(new PlayerTagBase(TheClient));

            CommandSystem.PostInit();
        }
开发者ID:Morphan1,项目名称:Voxalia,代码行数:62,代码来源:ClientCommands.cs


示例16: MainPage

        public MainPage()
        {
            this.InitializeComponent();
            CurrentCmd = null;
            GetCommands("Commands");
            NavLinksList.DataContext = Commands.CommandsList;

        }
开发者ID:djaus2,项目名称:IoTSysInfo,代码行数:8,代码来源:MainPage.xaml.cs


示例17: MidiMessage

 public MidiMessage(uint message, uint timestamp)
 {
     this.TimeStamp = timestamp;
     this.Channel = message & 0xf;
     this.Command = (Commands)((message >> 4) & 0xf);
     this.Param1 = (message >> 8) & 0xff;
     this.Param2 = (message >> 16) & 0xff;
 }
开发者ID:olofn,项目名称:db_public,代码行数:8,代码来源:MidiMessage.cs


示例18: Command

 public Command(Commands command, string data)
 {
     CurrentCommand = Enum.GetName(typeof(Commands), command);
     Data = data;
     ValuesList = new List<List<object>>();
     ColumnsList = new List<string>();
     TypesList = new List<string>();
 }
开发者ID:vit2005,项目名称:Multitier-Project,代码行数:8,代码来源:Command.cs


示例19: ChatMessage

 public ChatMessage(Commands command, string sender, string body, byte[] icon)
     : this()
 {
     Command = command;
     Sender = sender;
     Body = body;
     Icon = icon;
 }
开发者ID:TakeAsh,项目名称:cs-p2pChat,代码行数:8,代码来源:ChatMessage.cs


示例20: ToBytes

 public static byte[] ToBytes(Commands command)
 {
     int intValue = (int)command;
     byte[] intBytes = BitConverter.GetBytes(intValue);
     if (BitConverter.IsLittleEndian)
         Array.Reverse(intBytes);
     return intBytes;
 }
开发者ID:virrkharia,项目名称:dynamight,代码行数:8,代码来源:RemoteSlave.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Comment类代码示例发布时间:2022-05-24
下一篇:
C# CommandType类代码示例发布时间: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