public ForInvestigationViewModel(INavigationService navigationService) { //BackColor.Value = Color.Blue; var toggle = false; GoCommand.Subscribe(async _ => { On.Value = !On.Value; }); HogeCommand = CanExecute.ToReactiveCommand(); HogeCommand.Subscribe(_ => { Debug.WriteLine("Cell Tap!"); }); Color.Value = Xamarin.Forms.Color.Blue; WidthToggle.Subscribe(x => { Width.Value = x ? 2.0d : 0.0d; }); RadiusToggle.Subscribe(x => { Radius.Value = x ? 8.0d : 0.0d; }); }
internal bool Run() { if (GoCommand.CanExecute(null)) { GoCommand.Execute(null); return(true); } return(false); }
public void GoCommandReturnsPlay() { GameState expected = GameState.Play; var map = new Mock <IMap>(); var command = new GoCommand(map.Object, Direction.North); var actual = command.Execute(); Assert.AreEqual(expected, actual); }
public void CanParseGoCommandWithDepth() { // Assemble string[] commandArgs = "depth 5".Split(' '); // Act var command = new GoCommand(commandArgs); // Assert Assert.Equal(5, command.Depth); }
private void Runner_ExecutionStateChanged(object sender, ExecutionStateChangedEventArgs e) { App.Current.Dispatcher.Invoke(() => { switch (e.ExecutionState) { case ExecutionState.Stopped: ProgramCode.HighlightedLineNumber = 0; ProgramInteraction.HideInputPrompt(); break; case ExecutionState.Paused: if (SingleStepMode) { ProgramCode.HighlightedLineNumber = runner.LineNumber; ProgramInteraction.HideInputPrompt(); } else { // Want to run at full speed runner.ExecuteNextLine(); } break; case ExecutionState.Running: if (SingleStepMode) { ProgramCode.HighlightedLineNumber = 0; ProgramInteraction.HideInputPrompt(); } break; case ExecutionState.WaitingForInput: ProgramInteraction.ShowInputPrompt(!string.IsNullOrWhiteSpace(runner.Prompt) ? runner.Prompt : "Please enter your response:"); if (SingleStepMode) { ProgramCode.HighlightedLineNumber = runner.LineNumber; } break; } OnPropertyChanged(nameof(ExecutionState)); GoCommand.RaiseCanExecuteChanged(); StopCommand.RaiseCanExecuteChanged(); }); }
public ForInvestigationViewModel(INavigationService navigationService) { BackColor.Value = Color.Blue; var toggle = false; GoCommand.Subscribe(async _ => { CanExecute.Value = !CanExecute.Value; }); HogeCommand = CanExecute.ToReactiveCommand(); HogeCommand.Subscribe(_ => { Debug.WriteLine("Cell Tap!"); }); }
public UciClient(InteractiveConsole interactiveConsole) { BoardState = new BoardState(); BoardState.SetDefaultState(); _interactiveConsole = interactiveConsole; #if UCI_DEBUG_OUTPUT _debugMode = true; #endif _commands = new Dictionary <string, IUciCommand>(); _commands["quit"] = new QuitCommand(this); _commands["setoption"] = new SetOptionCommand(this); _commands["isready"] = new IsReadyCommand(this); _commands["ucinewgame"] = new UciNewGameCommand(this); _commands["position"] = new PositionCommand(this); _commands["debug"] = new DebugCommand(this); _commands["go"] = new GoCommand(this); _commands["stop"] = new StopCommand(this); IterativeDeepening.OnSearchUpdate += OnSearchUpdate; }
private static void Main(string[] args) { if (args.Length < 1) { Console.WriteLine("Not enough arguments !"); return; } Config.Model = args[0].ToLower().UppercaseFirst(); var command = ""; if (args.Length > 1) { command = args[1].ToLower(); } if (args.Length > 2) { Config.Area = args[2].ToLower().UppercaseFirst(); } Config.ModelsPath = Environment.CurrentDirectory + "\\"; Config.ViewModelsPath = new System.IO.DirectoryInfo(Config.ModelsPath).Parent.FullName + "\\ViewModels\\"; Config.RepositoryPath = new System.IO.DirectoryInfo(Config.ModelsPath).Parent.Parent.FullName + "\\Repository\\"; Config.ServicePath = new System.IO.DirectoryInfo(Config.ModelsPath).Parent.Parent.FullName + "\\Service\\"; if (string.IsNullOrEmpty(Config.Area)) { Config.ControllerPath = new System.IO.DirectoryInfo(Config.ModelsPath).Parent.Parent.Parent.FullName + "\\Portal.Web\\Controllers\\"; Config.ViewsPath = new System.IO.DirectoryInfo(Config.ModelsPath).Parent.Parent.Parent.FullName + "\\Portal.Web\\Views\\" + Config.Model + "\\"; } else { Config.ControllerPath = new System.IO.DirectoryInfo(Config.ModelsPath).Parent.Parent.Parent.FullName + "\\Portal.Web\\Areas\\" + Config.Area + "\\Controllers\\"; Config.ViewsPath = new System.IO.DirectoryInfo(Config.ModelsPath).Parent.Parent.Parent.FullName + "\\Portal.Web\\Areas\\" + Config.Area + "\\Views\\" + Config.Model + "\\"; } var viewsDir = new System.IO.DirectoryInfo(Config.ViewsPath); if (!viewsDir.Exists) { viewsDir.Create(); } Config.PropertyNames = ClassHelper.GetPropertyNames(Config.ModelsPath + Config.Model + ".cs"); Config.PropertyTypes = ClassHelper.GetPropertyTypes(Config.ModelsPath + Config.Model + ".cs"); Config.PropertyDeclarations = ClassHelper.GetPropertyDeclarations(Config.ModelsPath + Config.Model + ".cs"); switch (command) { case "sr": case "service": var iserviceCommand = new IServiceCommand(); var serviceCommand = new ServiceCommand(); iserviceCommand.Execute(); serviceCommand.Execute(); break; case "rp": case "repository": var irepositoryCommand = new IRepositoryCommand(); var repositoryCommand = new RepositoryCommand(); irepositoryCommand.Execute(); repositoryCommand.Execute(); break; case "vm": case "viewmodel": var viewModelCommand = new ViewModelCommand(); viewModelCommand.Execute(); break; case "ad": case "addmodel": var addModel = new AddModelCommand(); addModel.Execute(); break; case "vi": case "views": var indexCommand = new IndexCommand(); var createCommand = new CreateCommand(); var editCommand = new EditCommand(); var deleteCommand = new DeleteCommand(); var detailsCommand = new DetailsCommand(); indexCommand.Execute(); createCommand.Execute(); editCommand.Execute(); deleteCommand.Execute(); detailsCommand.Execute(); break; case "cr": case "controller": var controllerCommand = new ControllerCommand(); controllerCommand.Execute(); break; case "go": default: var goCommand = new GoCommand(); goCommand.Execute(); break; } }