public void ValidCommandAsEnum_IsSavedWithValue() { var cmd = new LauncherCommand(Command.Up, 100); Assert.AreEqual(Command.Up, cmd.Command); Assert.AreEqual(100, cmd.Value); }
private void AssertExecuteCommand(LauncherCommand launcher, string command) { Assert.That(launcher, Is.InstanceOf <ExecuteCommand>()); var execute = launcher as ExecuteCommand; Assert.That(execute.Command, Is.EqualTo(command)); }
private void OnSendCommand(LauncherCommand command) { System.Console.WriteLine("Command received.... {0}", command); var commandBytes = command.ConvertCommandToBytes(); if (commandBytes != null) { _launcher.SendCommand(commandBytes); } }
void AnimationWindow_PreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Up && !SearchTextBox.IsPopupOpen) { if (CommandsListView.SelectedIndex <= 0) { return; } CommandsListView.SelectedIndex--; } if (e.Key == Key.Down && !SearchTextBox.IsPopupOpen) { CommandsListView.SelectedIndex++; } if (e.Key == Key.Enter && !SearchTextBox.IsPopupOpen) { LauncherCommand command = (LauncherCommand)CommandsListView.SelectedItem; Dispatcher.BeginInvoke((Action)(() => command.Execute(SearchTextBox.Text))); Close(); // Prevents the RecipientEditorControl from receiving this key when we're closing the window e.Handled = true; } if (e.Key == Key.Escape) { if (SearchTextBox.SuppressListForCurrentWord || !SearchTextBox.IsPopupOpen) { Close(); } SearchTextBox.SuppressListForCurrentWord = true; } }
public void CommandAsUppercaseString_IsConvertedToEnum() { var cmd = new LauncherCommand("UP", 100); Assert.AreEqual(Command.Up, cmd.Command); }
bool CommandFilter(object source) { LauncherCommand command = (LauncherCommand)source; return(command.CanExecute(SearchTextBox.Text)); }
public static void SendCommand(string[] launcherNames, LauncherCommand command) { var context = GlobalHost.ConnectionManager.GetHubContext<LauncherHub>(); context.Clients.Groups(launcherNames).sendCommand(command); }