public void SkillAllTaggedNodes() { if (!GetCheckedNodes().Except(SkilledNodes).Any()) { Popup.Info(L10n.Message("Please tag non-skilled nodes by right-clicking them.")); return; } try { // Use the SettingsViewModel without View and with a fixed SteinerTabViewModel. var settingsVm = new SettingsViewModel(this, new SteinerTabViewModel(this)); settingsVm.StartController += (sender, args) => { var dialog = new ControllerWindow() { Owner = MainWindow, DataContext = args.ViewModel }; dialog.ShowDialog(); }; settingsVm.RunCommand.Execute(null); } catch (Exception e) { Popup.Error(L10n.Message("Error while trying to find solution"), e.Message); Debug.WriteLine("Exception in 'Skill Tagged Nodes':"); Debug.WriteLine(e.Message); } }
// This function is called at the very start of application execution. public void StartApplication() { // make an acquisitor and connect ourself to its events acquisitor = new Acquisitor(); acquisitor.Data += new DataEventHandler(DataHandler); acquisitor.ScanFinished += new ScanFinishedEventHandler(ScanFinishedHandler); // ask the remoting system for access to the EDMHardwareController //RemotingConfiguration.RegisterWellKnownClientType( // Type.GetType("EDMHardwareControl.Controller, EDMHardwareControl"), // "tcp://localhost:1172/controller.rem" // ); controllerWindow = new ControllerWindow(this); controllerWindow.Show(); // initialise the profile manager profileManager.Window = controllerWindow; profileManager.Start(); // try to load in the last profile set // first deserialize the profile set path //try //{ // BinaryFormatter bf = new BinaryFormatter(); // String settingsPath = (string)Environs.FileSystem.Paths["settingsPath"]; // String filePath = settingsPath + "\\ScanMaster\\profilePath.bin"; // FileStream fs = File.Open(filePath, FileMode.Open); // lastProfileSetPath = (string)bf.Deserialize(fs); // fs.Close(); //} //catch (Exception) //{ // Console.Error.WriteLine("Couldn't find saved profile path"); //} //try //{ // if (lastProfileSetPath != null) LoadProfileSet(lastProfileSetPath); //} //catch (Exception e) //{ // Console.Error.WriteLine("Couldn't load last profile set"); // Console.Error.WriteLine(e.Message); //} // initialise the parameter helper parameterHelper = new ParameterHelper(); parameterHelper.Initialise(); // connect the acquisitor to the profile manager, which will send it events when the // user is in tweak mode. profileManager.Tweak += new TweakEventHandler(acquisitor.HandleTweak); // Get access to any other applications required Environs.Hardware.ConnectApplications(); // run the main event loop Application.Run(controllerWindow); }
/* * Open the window where the mapping will be shown to the user */ static void GetXBOX360Controller() { ControllerWindow _window = new ControllerWindow(); _window.titleContent = new GUIContent("Controller Mapping"); _window.Init(); _window.Show(); }
public async Task <IEnumerable <ushort>?> ShowControllerDialogAsync(object context, ISolver solver, string generatorName, SkillTree tree) { var vm = new ControllerViewModel(solver, generatorName, tree, this); var view = new ControllerWindow(); Task <IEnumerable <ushort>?>?task = null; await ShowDialogAsync(context, vm, view, () => task = vm.RunSolverAsync()); return(task is null ? null : await task); }
private void Start() { if (!Directory.Exists(PresetDir)) { try { DirectoryInfo info = Directory.CreateDirectory(PresetDir); } catch (Exception e) { Logger.LogError("Failed create directory for presets. \r\nException info:\r\n" + e.ToString()); } } CharacterApi.RegisterExtraBehaviour <ParamCharaController>(GUID); window = new ControllerWindow(WindowID.GetNewID(), WindowID.GetNewID(), WindowID.GetNewID()); }
/// <summary> /// Comprueba los datos seleccionados /// </summary> private bool ValidateData() { bool validated = false; // Comprueba los datos if (SelectedDefinition == null) { ControllerWindow.ShowMessage("Seleccione un tipo de archivo"); } else if (string.IsNullOrEmpty(FileName)) { ControllerWindow.ShowMessage("Introduzca el nombre de archivo"); } else { validated = true; } // Devuelve el valor que indica si los datos son correctos return(validated); }
// private int sequenceLength = 1; // private int shotEvery = 10000; // // MainWindow m; // public PatternGenTest(ControllerWindow m) { // this.m = m; }