public bool Close(IMachine coreMachine, bool prompt) { if (coreMachine == null) { return(false); } IPersistableMachine pm = coreMachine as IPersistableMachine; bool remove = pm == null; if (pm != null && pm.PersistantFilepath == null) { if (prompt) { ConfirmCloseEventArgs args = new ConfirmCloseEventArgs(String.Format("Are you sure you want to close the \"{0}\" machine without persisting it?", coreMachine.Name)); ConfirmClose?.Invoke(this, args); if (!args.Result) { return(false); } } remove = true; } if (remove) { _model.RemoveMachine(coreMachine); } coreMachine.Close(); return(true); }
public bool CloseAll() { lock (Machines) { foreach (IMachine machine in Machines) { if (!(machine is IPersistableMachine persistableMachine) || persistableMachine.PersistantFilepath != null) { continue; } ConfirmCloseEventArgs args = new ConfirmCloseEventArgs("There are machines which haven't been persisted yet. Are you sure you want to exit?"); ConfirmClose?.Invoke(this, args); if (!args.Result) { return(false); } break; } List <IMachine> machines = Machines.ToList(); foreach (IMachine machine in machines) { Close(machine, false); } } return(true); }
// Start is called before the first frame update void Start() { playerUI = transform.GetChild(6).gameObject; menuBase = new MenuBase(this, transform.GetChild(2).gameObject); confirmSave = new ConfirmSave(this, transform.GetChild(4).gameObject); confirmClose = new ConfirmClose(this, transform.GetChild(3).gameObject); optionMenu = new OptionMenu(this, transform.GetChild(5).gameObject); menuBase.lootPanel.SetActive(false); confirmSave.lootPanel.SetActive(false); confirmClose.lootPanel.SetActive(false); optionMenu.lootPanel.SetActive(false); // 레이어용. MappingInfo mapping = new MappingInfo("MenuUI"); mapping.Enroll("MenuUI"); }
private static void CloseChat(String Telefone) { SearchCellphone = Driver.FindElement(By.XPath("/html/body/div[1]/div/div[4]/div[2]/form/div/div[1]/input")); //InputCellphone.Click(); //Thread.Sleep(3000); SearchCellphone.SendKeys($"{Telefone}"); SearchName = Driver.FindElement(By.XPath("/html/body/div[1]/div/div[5]/div/div/div/div/div[1]/div/div/ol/li[1]/a")); SearchName.Click(); //caixa-cliente-2686206 id chat ///html/body/div[7]/div[2]/div/div/div/div/div/div/div/div[2]/span[2] Caixa de dialogo Chat = Driver.FindElement(By.XPath("/html/body/div[1]/div/div[5]/div/div/div/div/div[1]/div/div/ol/li[1]/a")); Chat.Click(); CloseButton = Driver.FindElement(By.XPath("/html/body/div[1]/div/div[5]/div/div/div/div/div[2]/header/div[2]/a[7]/span")); //"/html/body/div[1]/div/div[9]/div/div/div[3]/button[1]")); //Thread.Sleep(2000); CloseButton.Click(); ConfirmClose = Driver.FindElement(By.XPath("/html/body/div[1]/div/div[9]/div/div/div[3]/button[1]")); ConfirmClose.Click(); }