private void ManagerOnDisconnected(object sender, EventArgs e) { var manager = DIFactory.Resolve <IServiceManager>(); manager.Disconnect((Guid)CurrentUser.Guid); CloseWindow?.Invoke(this, EventArgs.Empty); }
/// <summary> /// Closes the application. /// </summary> public virtual void Close() { CloseWindow.Raise(new Notification() { Title = "Closing confirmation", Content = "The window will be closed? Are you sure?" }); }
public ViewDirectorySelector(CloseWindow aCloseWindow, ViewDirectoryTree aViewDirectoryTree, DirectoryInfo aDirectoryInfo) { closeWindow = aCloseWindow; viewDirectoryTree = aViewDirectoryTree; directoryInfo = aDirectoryInfo; isPullDown = false; }
public IEnumerator SpawnArbeauContext() { yield return(new WaitForSeconds(1f)); taskMan = GetComponent <TaskManager>(); //I feel like I put this here for a reason CreateTasks(); int[] cnt = LowHighCount(); if (!gameMan.GetArbeauOff()) { for (int ii = 0; ii < taskIndex.Length; ii++) { GameObject win; List <string> contextList = new List <string>(); win = (GameObject)Instantiate(arbeau, new Vector2(0f, 0f), transform.rotation); CloseWindow closeButton = win.transform.GetChild(3).GetComponent <CloseWindow>(); win.transform.SetParent(GameObject.Find("Canvas").transform, false); win.transform.localPosition = RandomizePosition(ii); win.name = "Arbeau Context Window " + ii; contextList = GetContext(ii); closeButton.SetTextList(contextList); } } }
public LocationInputViewModel(ITheme appliedTheme) { locationSetter.PopulateCountryCollection(TypeaheadCountryList); _locationInputFields = new LocationInputFields(OnCountrySet); CloseWindow = new CloseWindow(); Theme = appliedTheme; }
void Start() { m_CloseWindow = m_Window.GetComponentInChildren <CloseWindow>(); m_Window.SetActive(false); player = GameObject.FindGameObjectWithTag("Player"); source = GetComponent <AudioSource>(); }
IEnumerator SpawnWindow() { gameMan.SetLoadingCursor(2); yield return(new WaitForSeconds(0.75f)); GameObject winObj; winObj = (GameObject)Instantiate(window, new Vector2(0f, 0f), transform.rotation); winObj.transform.SetParent(GameObject.Find("Canvas").transform, false); winObj.transform.localPosition = new Vector2(-130f, 0f); if (winObjName.Length > 0) { winObj.name = winObjName; } //unopened = false; firstClick = false; if (spawn == SpawnType.ArbeauWindow) { winObj.name = "Arbeau Alert"; CloseWindow closeButton = winObj.transform.GetChild(3).GetComponent <CloseWindow>(); closeButton.SetTextList(winText); } //SetInactiveSprite(); }
//called from GameManager.cs public void SpawnArbeauWinLose(int index, string type) { GameObject win; win = (GameObject)Instantiate(arbeau, new Vector2(0f, 0f), transform.rotation); win.transform.SetParent(GameObject.Find("Canvas").transform, false); win.transform.localPosition = RandomizePosition(index); CloseWindow closeButton = win.transform.GetChild(3).GetComponent <CloseWindow>(); List <string> contextList = new List <string>(); win.name = "Arbeau " + type + " Window " + index; if (type.Equals("Win")) { contextList = GetWin(index); closeButton.SetTextList(contextList); } else if (type.Equals("Lose")) { contextList = GetLose(index); closeButton.SetTextList(contextList); } }
public LocationErrorViewModel(ITheme appliedTheme) { _closeWindow = new CloseWindow(); _setExitMode = new SetExitMode(this); ExitMode = false; Theme = appliedTheme; }
private void Button_Click(object sender, RoutedEventArgs e) { if (CTS != null) { CTS.Cancel(); CloseWindow.Invoke(this, new EventArgs()); } }
public void ReportProgress(double value) { PB.Value = value; if (value == 100) { CloseWindow.Invoke(this, new EventArgs()); } }
private void TestClose() { // Your logic here // do something // Finally, close the window CloseWindow?.Invoke(); }
private void OnLogin() { Trace.WriteLine("Logging in"); // do your login stuff // If Login OK continue here NewWindow.Invoke(_container.Resolve <MainWindow>()); CloseWindow.Invoke(); }
public ViewConfigLoopTool(CloseWindow aCloseWindow) { closeWindow = aCloseWindow; captions = new string[2] { "On", "Off" }; grid = 0; }
public TwitterConfigViewModel(TwitterConfig twitterConfig, LogViewer logViewer) { TwitterConfig = twitterConfig; LogViewer = logViewer; SaveItems = ReactiveCommand.Create(async() => { await Helpers.SaveConfigFile <Twitter>(TwitterConfig); CloseWindow.OnNext(true); }); }
/// <summary> Инвокатор события закрытия окна </summary> private void OnCloseWindow() { CloseWindow?.Invoke(this, EventArgs.Empty); _viewModelPasswordBox.EventViewModel -= ViewModelPasswordBoxOnEventViewModel; PasswordBoxUser.PasswordChanged -= PasswordBoxUserOnPasswordChanged; _viewModelPasswordBox.Dispose(); }
public BankingInfoPage withCloseWindow() { // WebDriverWait wait0 = new WebDriverWait(driver, TimeSpan.FromSeconds(10)); // wait0.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementIsVisible(By.CssSelector("button[class='close']"))); IJavaScriptExecutor jse5 = (IJavaScriptExecutor)driver; jse5.ExecuteScript("arguments[0].scrollIntoView()", CloseWindow); CloseWindow.Click(); return(this); }
public ComponentSettingsLoop(CloseWindow aCloseWindow, Dictionary <string, string> aLanguage) { closeWindow = aCloseWindow; description = aLanguage["CUT"]; captions = new string[2] { aLanguage["ON"], aLanguage["OFF"] }; grid = 0; }
public void BlockCreateEmptyApplication() { Pages.Scheduler_Page.EnterOpenBlockWindow(); CreateNewSlot.ClickOn(); CreateNewBlock.ClickOn(); softAssert.VerifyElementPresentInsideWindow(SaveAndClose, CancelOpenBlock); SaveAndClose.ClickOn(); softAssert.VerifyErrorMsg(); CancelOpenBlock.ClickOn(); CloseWindow.ClickOn(); }
public UpdateWindow() { InitializeComponent(); maxticks = new UpdateMaxTicks(this.SetMaxTicks); newtick = new UpdateTick(this.ProgressTick); setstatus = new UpdateStatus(this.NewStatus); weredone = new CloseWindow(this.Done); newprogress = new UpdateProgressText(this.setspeed); addticks = new UpdateAddMaxTicks(this.AddMaxTicks); runthread = false; this.KeyPreview = true; }
/// <summary> /// Initializes the program settings window /// </summary> /// <param name="mainWindow"></param> public ProgramSettingsWindow(MainWindow mainWindow) { _mainWindow = mainWindow; _mainWindow.GotKeyboardFocus += GainFocus; InitializeComponent(); Left = _mainWindow.Left + (_mainWindow.Width / 2 - Width / 2); Top = _mainWindow.Top + (_mainWindow.Height / 2 - Height / 2) + 55; CloseWindow.Focus(); StyleController.ValidStyles.Remove("Windows"); LoadSettings(); }
public PackageViewModel(Guid id) { _id = id; this.Save = new DelegateCommand(() => { if (this.Id == Guid.Empty) { return; } _algoIds = this.AlgoSelectItems.Where(a => a.IsChecked).Select(a => a.SysDicItemVm.Id).ToList(); if (NTMinerRoot.Instance.PackageSet.Contains(this.Id)) { VirtualRoot.Execute(new UpdatePackageCommand(this)); } else { VirtualRoot.Execute(new AddPackageCommand(this)); } CloseWindow?.Invoke(); }); this.Edit = new DelegateCommand <FormType?>((formType) => { if (this.Id == Guid.Empty) { return; } VirtualRoot.Execute(new PackageEditCommand(formType ?? FormType.Edit, this)); }); this.Remove = new DelegateCommand(() => { if (this.Id == Guid.Empty) { return; } this.ShowDialog(new DialogWindowViewModel(message: $"您确定删除{this.Name}内核包吗?", title: "确认", onYes: () => { VirtualRoot.Execute(new RemovePackageCommand(this.Id)); })); }); this.BrowsePackage = new DelegateCommand(() => { OpenFileDialog openFileDialog = new OpenFileDialog { InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop), Filter = "zip (*.zip)|*.zip", FilterIndex = 1 }; if (openFileDialog.ShowDialog() == DialogResult.OK) { string package = Path.GetFileName(openFileDialog.FileName); this.Name = package; } }); }
/// <summary> /// Кнопка, вызывающая окно потверждения для закрытия приложения /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ExitButton_MouseDown(object sender, MouseButtonEventArgs e) { var closeWindow = new CloseWindow(); closeWindow.TextExit.Text = this._nameLabelExit; closeWindow.ShowDialog(); if (closeWindow.con == true) { this.Close(); } else { e.Handled = true; } }
protected ADragWindow(CloseWindow aCloseWindow, Rect aRectWindow) { closeWindow = aCloseWindow; rectWindow = aRectWindow; rectWindowPre = rectWindow; textureCursorMove = TextureLoader.Load("Graphic/CursorMove.png"); textureCursorVirtical = TextureLoader.Load("Graphic/CursorVirtical.png"); textureCursorHorizontal = TextureLoader.Load("Graphic/CursorHorizontal.png"); textureCursorRightUpLeftDown = TextureLoader.Load("Graphic/CursorRightUpLeftDown.png"); textureCursorLeftUpRightDown = TextureLoader.Load("Graphic/CursorLeftUpRightDown.png"); isOnFrameRectTop = false; isOnFrameRectBottom = false; isOnFrameRectLeft = false; isOnFrameRectRight = false; }
protected AViewDrag(CloseWindow aCloseWindow, Rect aRectWindow) { closeWindow = aCloseWindow; rectWindow = aRectWindow; rectWindowPre = rectWindow; //textureCursorMove = ( Texture2D )Resources.Load( "Cursor/Move", typeof( Texture2D ) ); textureCursorVirtical = ( Texture2D )Resources.Load("Cursor/Virtical", typeof(Texture2D)); textureCursorHorizontal = ( Texture2D )Resources.Load("Cursor/Horizontal", typeof(Texture2D)); textureCursorRightUpLeftDown = ( Texture2D )Resources.Load("Cursor/diagonal45", typeof(Texture2D)); textureCursorLeftUpRightDown = ( Texture2D )Resources.Load("Cursor/diagonal135", typeof(Texture2D)); isOnFrameRectTop = false; isOnFrameRectBottom = false; isOnFrameRectLeft = false; isOnFrameRectRight = false; }
public Window GetWindow(int height = 600, int width = 400) { Window Window = new Window() { WindowStartupLocation = WindowStartupLocation.CenterOwner, Width = width, Height = height, }; Window.Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = new Uri("/Resources/ResourcesMerge.xaml", UriKind.Relative) }); closeWindow = new CloseWindow(Window.Close); return(Window); }
public MinerClientSettingViewModel(MinerClientViewModel[] minerClients) { if (minerClients != null && minerClients.Length == 1) { _isAutoBoot = minerClients[0].IsAutoBoot; _isAutoStart = minerClients[0].IsAutoStart; } this.Save = new DelegateCommand(() => { if (minerClients != null && minerClients.Length != 0) { foreach (var item in minerClients) { Client.NTMinerDaemonService.SetAutoBootStartAsync(item.MinerIp, this.IsAutoStart, this.IsAutoStart); item.Refresh.Execute(null); } } CloseWindow?.Invoke(); }); }
public void SearchAvailbleTimeApplication() { try { ExpertiseSelect.SendKeys(Keys.ArrowDown); ExpertiseSelect.SendKeys(Keys.ArrowDown); Thread.Sleep(500); var durationTest = Browser.Driver.FindElement(By.XPath("//*[@id='findTimeSlotForm']/div/div[2]/div[1]/div[1]/div[7]/div/div/span[5]/span/input[1]")).GetAttribute("aria-valuenow"); SearchBtn.ClickOn(); FirstFreeTime.ClickOn(); FirstFreeTimeSetMeeting.ClickOn(); softAssert.VerifyElementPresentInsideWindow(Pages.Meeting_Page.ApproveMeeting, Pages.Meeting_Page.CancelMeeting); softAssert.VerifyElementHasEqual(Pages.Meeting_Page.MeetingDuration.GetAttribute("aria-valuenow"), durationTest); } catch (ElementNotVisibleException) { CloseWindow.ClickOn(); Log.Error("bug with searching availble time"); } }
/// <summary> /// Завершение лаб. работы /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click(object sender, RoutedEventArgs e) { string textEndLR = "Завершить лабораторную работу?"; var windowEnd = new CloseWindow(); windowEnd.TextExit.Text = textEndLR; windowEnd.ShowDialog(); if (windowEnd.con == true) { var loginWindow = new LoginWindow(ComModel.ExportList); loginWindow.ShowDialog(); this.Close(); e.Handled = true; } else { e.Handled = true; } }
private void AddRepository() { if (_repositoryList.Repositories.Any(item => item.RepositoryPath == FolderPath)) { return; } RepositoryType repositoryType = RepositoryType.Unknown; bool parseSuccess = Enum.TryParse(SelectedRepository, true, out repositoryType); if (!parseSuccess) { return; } var repository = _repositoryFactory.Create(repositoryType, FolderPath); _repositoryList.Add(repository); CloseWindow.Invoke(this, null); }
public void SetWindowClose() { CloseWindow mi = new CloseWindow(CloseWindowM); Invoke(mi, new object[] { }); }