public void ExamStart(Test test, Group group) { TestingWindow tW = new TestingWindow(); TestingViewModel tVM = new TestingViewModel(test, Login, group); tVM.CloseView += tW.CloseDialog; tW.DataContext = tVM; if (tW.ShowDialog() == true) { Wrapper.SendTestResult(tVM.Result); // ExecGroupRefresh(null); } tVM.Dispose(); }
private void Startup() { LoggerFacade.Debug("*TsGui startup started"); this.StartupFinished = false; this._prodmode = this._envController.Init(); XElement xconfig = this.ReadConfigFile(); if (xconfig == null) { return; } //this.LoadXml(x); try { this.LoadXml(xconfig); } catch (TsGuiKnownException e) { string msg = "Error loading config file" + Environment.NewLine + e.CustomMessage + Environment.NewLine + e.Message; this.CloseWithError("Error loading config file", msg); return; } this.PopulateHwOptions(); //now init everything this._optionlibrary.InitialiseOptions(); //if prodmode isn't true, the envcontroller couldn't connect to sccm //prompt the user if they want to continue. exit if not. if (this._prodmode == true) { this._envController.HideProgressUI(); } else { if (this.PromptTestMode() != true) { this.Cancel(); return; } if (this._livedata == true) { this._showtestwindow = true; } } //subscribe to closing event this.ParentWindow.Closing += this.OnWindowClosing; if (this._pages.Count > 0) { LoggerFacade.Debug("Loading pages"); this.CurrentPage = this._pages.First(); //update group settings to all controls foreach (IToggleControl t in this._toggles) { t.InitialiseToggle(); } this.ParentWindow.DataContext = this.TsMainWindow; // Now show and close the ghost window to make sure WinPE honours the // windowstartuplocation LoggerFacade.Trace("Loading ghost window"); GhostWindow ghost = new GhostWindow(); ghost.Show(); ghost.Close(); this.UpdateWindow(); this.ParentWindow.Visibility = Visibility.Visible; this.ParentWindow.WindowStartupLocation = this.TsMainWindow.WindowLocation.StartupLocation; this.StartupFinished = true; if ((this._debug == true) || (this._showtestwindow == true)) { this._testingwindow = new TestingWindow(this); } GuiTimeout.Instance?.Start(this.OnTimeoutReached); LoggerFacade.Info("*TsGui startup finished"); } else { //No pages, finish using only the NoUI options LoggerFacade.Info("*No pages configured. Finishing TsGui"); this.Finish(); } }