Пример #1
2
 public void Update()
 {
     if (doInitDelay)
     {
         initialDelay--;
     }
     if (initialDelay <= 0)
     {
         doInitDelay = false;
         currentCommand = new NullCommand();
         keyboardState = Keyboard.GetState();
         foreach (Keys key in keyboardState.GetPressedKeys())
         {
             if (commandLibrary.ContainsKey(key))
             {
                 currentCommand = commandLibrary[key];
                 currentCommand.Execute();
                 break;
             }
         }
         if (keyboardState.GetPressedKeys().Length == 0)
         {
             player.Idle();
         }
     }
 }
Пример #2
0
        public CommunicationsHandler(ICommunicationsHandlerOwner owner)
        {
            this.owner = owner;

            owner.AddIn <ICommands>(this);
            this.interfaceout = owner.AddOut <CommunicationsHandler, ICommands>(this);
        }
Пример #3
0
        private void CreateView(ICommands cmd, IAParser parser, IATranslator translator, IViewDefinition view)
        {
            ASTNodeList   aNodes         = null;
            StringBuilder createViewStmt = new StringBuilder("create view ");

            createViewStmt.Append(view.ViewName);

            if (view.DbType == DbTypeName.Any || parser.ExpandEmptyStrings)
            {
                aNodes = parser.CreateNodeList(view.SelectStatement);
            }

            if (view.DbType == DbTypeName.Any)
            {
                if (!ColumnListContainStar(aNodes))
                {
                    createViewStmt.Append(CreateColumnList(aNodes));
                }

                aNodes = translator.Translate(aNodes);
            }

            createViewStmt.Append(" as ");

            if (aNodes != null)
            {
                createViewStmt.Append(aNodes);
            }
            else
            {
                createViewStmt.Append(view.SelectStatement);
            }

            cmd.ExecuteNonQuery(createViewStmt.ToString());
        }
 public TestInMemoryDatabase()
 {
     ModelQueries = Database.GetQueriesInterface<TestModel>();
     StorageModelQueries = Database.GetQueriesInterface<TestModel, TestMetadata>();
     ModelCommands = Database.GetCommandsInterface<Guid, TestModel>();
     StorageModelCommands = Database.GetCommandsInterface<Guid, TestModel, TestMetadata>();
 }
 public TestInMemoryDatabase()
 {
     ModelQueries         = Database.GetQueriesInterface <TestModel>();
     StorageModelQueries  = Database.GetQueriesInterface <TestModel, TestMetadata>();
     ModelCommands        = Database.GetCommandsInterface <Guid, TestModel>();
     StorageModelCommands = Database.GetCommandsInterface <Guid, TestModel, TestMetadata>();
 }
Пример #6
0
        private void Initialize(IDbContext dbContext)
        {
            _dbSchema = dbContext.PowerPlant.CreateDbSchema();
            _commands = dbContext.PowerPlant.CreateCommands();

            _dbSchema.DropTable(_testTable);
        }
Пример #7
0
 void Update()
 {
     if (Input.GetKey(upKey))
     {
         moveUp = new MoveUpCommand(this.transform, _speed);
         moveUp.Execute();
         CommandManager.Instance.AddBuffer(moveUp);
     }
     else if (Input.GetKey(downKey))
     {
         moveDown = new MoveDownCommand(this.transform, _speed);
         moveDown.Execute();
         CommandManager.Instance.AddBuffer(moveDown);
     }
     else if (Input.GetKey(rightKey))
     {
         moveRight = new MoveRightCommand(this.transform, _speed);
         moveRight.Execute();
         CommandManager.Instance.AddBuffer(moveRight);
     }
     if (Input.GetKey(leftKey))
     {
         moveLeft = new MoveLeftCommand(this.transform, _speed);
         moveLeft.Execute();
         CommandManager.Instance.AddBuffer(moveLeft);
     }
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="convertor">Convertor</param>
 public PbsProSchedulerAdapter(ISchedulerDataConvertor convertor)
 {
     _log           = LogManager.GetLogger(typeof(PbsProSchedulerAdapter));
     _convertor     = convertor;
     _sshTunnelUtil = new SshTunnelUtils();
     _commands      = new LinuxCommands();
 }
Пример #9
0
 public void Notify(ICommands commands)
 {
     foreach (ITelephoneObserver teleTubbies in _observers)
     {
         teleTubbies.Update(commands);
     }
 }
        private void btn_Update_Click(object sender, EventArgs e)
        {
            ICommands icommands = (ICommands)commands;

            icommands.EmployeesUpdate(txt_EmployeesName.Text, Employes_ID);
            this.Close();
        }
Пример #11
0
        private void btn_Delete_Click(object sender, EventArgs e)
        {
            ICommands icommands = (ICommands)commands;

            icommands.CardDelete(id);
            this.Close();
        }
Пример #12
0
        public CommandConsole(string defaultPrompt) : base(defaultPrompt)
        {
            Commands = new Commands();

            Commands.AddCommand("console", false, "help", "help [<command>]",
                                "Get general command list or more detailed help on a specific command", Help);
        }
        private void btn_Delete_Click(object sender, EventArgs e)
        {
            ICommands icommands = (ICommands)commands;

            icommands.EmployeesDelete(Employes_ID);
            this.Close();
        }
Пример #14
0
 public void Down()
 {
     if (buffer >= inputBuffer)
     {
         buffer = 0;
         if (columnOne[selection].Key == currentCommand)
         {
             selection++;
             if (selection >= columnOne.Count)
             {
                 selection = 0;
             }
             currentCommand = columnOne[selection].Key;
         }
         else
         {
             selection++;
             if (selection >= columnTwo.Count)
             {
                 selection = 0;
             }
             currentCommand = columnTwo[selection].Key;
         }
     }
 }
Пример #15
0
 public void Up()
 {
     if (buffer >= inputBuffer)
     {
         buffer = 0;
         if (columnOne[selection].Key == currentCommand)
         {
             selection--;
             if (selection < 0)
             {
                 selection = columnOne.Count - 1;
             }
             currentCommand = columnOne[selection].Key;
         }
         else
         {
             selection--;
             if (selection < 0)
             {
                 selection = columnTwo.Count - 1;
             }
             currentCommand = columnTwo[selection].Key;
         }
     }
 }
Пример #16
0
        /// <summary>
        /// Invoke actions on commands.
        /// </summary>
        public void CommandRequest(string action)
        {
            MadeDictionary();
            ICommands command = commandsDictionary[action];

            command.Execute();
        }
Пример #17
0
 public ServerProgram(string path)
 {
     commands = new ServerCommands();
     SocketSettings.SocketSettings settings = new SocketSettings.SocketSettings(path);
     mlsToStop = settings.MlsOfDelay;
     server    = new Server(commands, settings);
 }
Пример #18
0
        public static int Process(string[] args, ICommands commands)
        {
            if (args == null)
            {
                throw new ArgumentNullException(nameof(args));
            }

            if (commands == null)
            {
                throw new ArgumentNullException(nameof(commands));
            }

            var commandInterpreter =
                new CSharpTest.Net.Commands.CommandInterpreter(DefaultCommands.Help, commands)
            {
                /* Sometimes ErrorLevel still has a value other than zero when testing.
                 * Maybe because this is a static class and a static member?
                 * Force it here.
                 */
                ErrorLevel = 0
            };

            commandInterpreter.Run(args);

            return(commandInterpreter.ErrorLevel);
        }
Пример #19
0
        private void Form_Main_Load(object sender, EventArgs e)
        {
            if (login)
            {
                form_ProjectLogin.ShowDialog();
                if (!form_ProjectLogin.transition)
                {
                    this.Close();
                }
                login = false;
            }
            Panel_Todo.Controls.Clear();
            Panel_InProgress.Controls.Clear();
            Panel_Revison.Controls.Clear();
            Panel_Check.Controls.Clear();
            Panel_Done.Controls.Clear();
            ICommands icommands = (ICommands)commands;

            CardNameList   = icommands.FillCardNametoFormMain(form_ProjectLogin.CardID);
            CardTextList   = icommands.FillCardTexttoFormMain(form_ProjectLogin.CardID);
            CardStatusList = icommands.FillCardStatustoFormMain(form_ProjectLogin.CardID);
            for (int i = 0; i < CardNameList.Count; i++)
            {
                Card_Add(CardStatusList[i], CardNameList[i], CardTextList[i]);
            }
        }
Пример #20
0
 public void Update()
 {
     flipBuffer++;
     currentCommand = new NullCommand();
     keyboardState  = Keyboard.GetState();
     foreach (Keys key in keyboardState.GetPressedKeys())
     {
         if (commandLibrary.ContainsKey(key))
         {
             currentCommand = commandLibrary[key];
             if (currentCommand.GetType() == flip.GetType())
             {
                 if (flipBuffer >= flipPatience)
                 {
                     currentCommand.Execute();
                     flipBuffer = 0;
                 }
             }
             else
             {
                 currentCommand.Execute();
             }
         }
     }
     if (currentCommand.GetType() == new NullCommand().GetType())
     {
         currentCommand = new IdleCommand(mario);
         currentCommand.Execute();
     }
 }
Пример #21
0
 public void Update()
 {
     if (doInitDelay)
     {
         initialDelay--;
     }
     if (initialDelay <= 0)
     {
         doInitDelay    = false;
         currentCommand = new NullCommand();
         keyboardState  = Keyboard.GetState();
         foreach (Keys key in keyboardState.GetPressedKeys())
         {
             if (commandLibrary.ContainsKey(key))
             {
                 currentCommand = commandLibrary[key];
                 currentCommand.Execute();
                 break;
             }
         }
         if (keyboardState.GetPressedKeys().Length == 0)
         {
             player.Idle();
         }
     }
 }
Пример #22
0
        public CommandConsole(string defaultPrompt) : base(defaultPrompt)
        {
            Commands = new Commands();

            Commands.AddCommand(
                "Help", false, "help", "help [<item>]",
                "Display help on a particular command or on a list of commands in a category", Help);
        }
Пример #23
0
        private void btn_Add_Click(object sender, EventArgs e)
        {
            ICommands icommands = (ICommands)commands;

            dtp_Date.Format = DateTimePickerFormat.Short;
            icommands.CardAdd(Card_ID, Card_Status, dtp_Date.Text.ToString(), txt_ActualTime.Text, rtb_Description.Text, rtb_Notes.Text);
            this.Close();
        }
Пример #24
0
 public TitleKeyController(GUI menu)
 {
     commandLibrary = new Dictionary <Keys, ICommands>();
     commandLibrary.Add(Keys.Q, currentCommand = new QuitCommand());
     commandLibrary.Add(Keys.Down, new MenuDownCommand(menu));
     commandLibrary.Add(Keys.Up, new MenuUpCommand(menu));
     commandLibrary.Add(Keys.Space, new MenuSelectCommand(menu));
 }
Пример #25
0
 public TitleKeyController(GUI menu, Game1 game)
 {
     this.game      = game;
     commandLibrary = new Dictionary <Keys, ICommands>();
     commandLibrary.Add(Keys.Q, currentCommand = new QuitCommand(game));
     commandLibrary.Add(Keys.S, new MenuDownCommand(menu));
     commandLibrary.Add(Keys.W, new MenuUpCommand(menu));
     commandLibrary.Add(Keys.Enter, new LoadLevelCommand(game.level.levelCurrent, game));
 }
Пример #26
0
 public GameHub(IDataBase db, ICache cache, ILogger <GameHub> logger, IWriteToClient writeToClient, ICommands commands, IUpdateClientUI updateClientUi)
 {
     _logger         = logger;
     _db             = db;
     _cache          = cache;
     _writeToClient  = writeToClient;
     _commands       = commands;
     _updateClientUi = updateClientUi;
 }
Пример #27
0
        private void panel_DragDrop(object sender, DragEventArgs e)
        {
            ICommands icommands = (ICommands)commands;
            Panel     parent    = sender as Panel;
            Button    button    = (Button)e.Data.GetData(typeof(Button));

            button.Parent    = parent;
            parent.BackColor = Color.FromArgb(210, 230, 3);
            icommands.CardStatusUpdate(Convert.ToInt32(button.Name), parent.Name);
        }
Пример #28
0
 public GameLoop(IWriteToClient writeToClient, ICache cache, ICommands commands, ICombat combat, IDataBase database, IDice dice, IUpdateClientUI client)
 {
     _writeToClient = writeToClient;
     _cache         = cache;
     _commands      = commands;
     _combat        = combat;
     _db            = database;
     _dice          = dice;
     _client        = client;
 }
Пример #29
0
 public EncounterController(UniversalGUI menu)
 {
     commandLibrary = new Dictionary<Keys, ICommands>();
     commandLibrary.Add(Keys.Up, currentCommand = new EncounterUpCommand(menu));
     commandLibrary.Add(Keys.Down, currentCommand = new EncounterDownCommand(menu));
     commandLibrary.Add(Keys.Left, currentCommand = new EncounterLeftCommand(menu));
     commandLibrary.Add(Keys.Right, currentCommand = new EncounterRightCommand(menu));
     commandLibrary.Add(Keys.Enter, currentCommand = new EncounterSelectCommand(menu));
     commandLibrary.Add(Keys.Escape, currentCommand = new GoBackMenuCommand(menu));
 }
Пример #30
0
 public EncounterController(UniversalGUI menu)
 {
     commandLibrary = new Dictionary <Keys, ICommands>();
     commandLibrary.Add(Keys.Up, currentCommand     = new EncounterUpCommand(menu));
     commandLibrary.Add(Keys.Down, currentCommand   = new EncounterDownCommand(menu));
     commandLibrary.Add(Keys.Left, currentCommand   = new EncounterLeftCommand(menu));
     commandLibrary.Add(Keys.Right, currentCommand  = new EncounterRightCommand(menu));
     commandLibrary.Add(Keys.Enter, currentCommand  = new EncounterSelectCommand(menu));
     commandLibrary.Add(Keys.Escape, currentCommand = new GoBackMenuCommand(menu));
 }
Пример #31
0
 public void Update()
 {
     currentCommand = new NullCommand();
     keyboardState  = Keyboard.GetState();
     foreach (Keys key in commandLibrabry)
     {
         currentCommand = commandLibrabry[key];
         currentCommand.Execute();
     }
     teno.Idle();
 }
Пример #32
0
 public void ObstacleAhead(ICommands commands)
 {
     if (r.Next(2) == 0)
     {
         Turn(currentBearing.Clockwise90(), commands);
     }
     else
     {
         Turn(currentBearing.CounterClockwise90(), commands);
     }
 }
 private void btn_Ok_Click(object sender, EventArgs e)
 {
     if (txt_EmployeesName.Text != "")
     {
         Name = txt_EmployeesName.Text;
         ICommands icommands = (ICommands)commands;
         icommands.EmployeesAdd(Name);
         Transition = true;
         this.Close();
     }
 }
Пример #34
0
 public KeyboardController(Player currentPlayer, Game1 game)
 {
     player = currentPlayer;
     commandLibrary = new Dictionary<Keys, ICommands>();
     commandLibrary.Add(Keys.W, currentCommand = new UpCommand(player));
     commandLibrary.Add(Keys.A, currentCommand = new LeftCommand(player));
     commandLibrary.Add(Keys.S, currentCommand = new DownCommand(player));
     commandLibrary.Add(Keys.D, currentCommand = new RightCommand(player));
     commandLibrary.Add(Keys.Space, currentCommand = new InteractCommand(player));
     commandLibrary.Add(Keys.Enter, currentCommand = new PauseCommand(game));
 }
Пример #35
0
        public FolderTransfer(ICommands commands, Transfers transfers, IFolder node, string destination)
        {
            Transfers = transfers;

            Source = (INode)node;
            Destination = destination;
            Status = Status.Idle;
            SubTransfers = new List<ITransfer>();

            Source.Updated += OnNodeUpdated;
            listingDone = false;
            commands.List(Source.FullPath);
        }
        public CameraPageViewModel(ICameraController cameraController, IModuleConfiguration moduleConfiguration,
            ICommands moduleCommands)
        {
            controller = cameraController;
            configuration = moduleConfiguration;
            commands = moduleCommands;

            configuration.StreamingValueChanged += OnStreamingChanged;

            UpdateStreamingButtons(configuration.Streaming);

            Window.Current.VisibilityChanged += OnVisibilityChanged;
        }
Пример #37
0
 public void Update()
 {
     currentCommand = new NullCommand();
     keyboardState = Keyboard.GetState();
     foreach (Keys key in keyboardState.GetPressedKeys())
     {
         if (commandLibrary.ContainsKey(key))
         {
             currentCommand = commandLibrary[key];
             currentCommand.Execute();
             break;
         }
     }
 }
Пример #38
0
 private KeyIndex GetKeyIndex(ICommands cmds, string id)
 {
     return _keyIndices.GetOrAdd(id, s => GetKeyIndexFromDisk(cmds, s));
 }
Пример #39
0
 private void SaveKeyIndex(ICommands cmds, KeyIndex keyedIndex, string id)
 {
     var bytes = SerializationHelper.Serialize(keyedIndex);
     cmds.SaveAsync(id, bytes);
 }
Пример #40
0
 private void FireSaveKeyIndex(ICommands cmds, KeyIndex keyedIndex, string id)
 {
     lock (keyedIndex)
     {
         
     }
 }
Пример #41
0
        public CommandConsole(string defaultPrompt) : base(defaultPrompt)
        {
            Commands = new Commands();

            Commands.AddCommand(
                "Help", false, "help", "help [<item>]",
                "Display help on a particular command or on a list of commands in a category", Help);
        }
Пример #42
0
        private static KeyIndex GetKeyIndexFromDisk(ICommands cmds, string id)
        {
            var keysBytes = cmds.Load(id);
            if (keysBytes == null)
                return new KeyIndex();

            return SerializationHelper.Deserialize<KeyIndex>(keysBytes);
        }
Пример #43
0
        public CommandConsole(string defaultPrompt) : base(defaultPrompt)
        {
            Commands = new Commands();

            Commands.AddCommand("console", false, "help", "help [<command>]", 
                    "Get general command list or more detailed help on a specific command", Help);
        }
Пример #44
0
 public Session(IDocumentStore store, ICommands commands)
     : base(store, store.Conventions, commands)
 {
 }
Пример #45
0
        public CommandConsole(string defaultPrompt) : base(defaultPrompt)
        {
			if (m_log.IsDebugEnabled) {
				m_log.DebugFormat ("{0} called", System.Reflection.MethodBase.GetCurrentMethod ().Name);
			}

            Commands = new Commands();

            Commands.AddCommand(
                "Help", false, "help", "help [<item>]",
                "Display help on a particular command or on a list of commands in a category", Help);
        }