public virtual void Restart(Action restartAction, bool useAsync = true) { if (CanRestart) { if (useAsync) { this.restartAction = restartAction; shouldRestart = true; Stop(); } else { // end modal session app.StopModal(); app.EndModalSession(Session); restartAction?.Invoke(); // restart new session Session = app.BeginModalSession(NativeWindow); Stopped = false; } } else { restartAction?.Invoke(); } }
partial void done(NSButton sender) { // save the values for later var editFields = editForm.Cells; List <NSString> objects = new List <NSString> { new NSString(editFields[FIRST_NAME].StringValue), new NSString(editFields[LAST_NAME].StringValue), new NSString(editFields[PHONE].StringValue) }; savedFields = NSMutableDictionary.FromObjectsAndKeys(objects.ToArray(), TestWindowController.Keys.ToArray()); NSApp.StopModal(); }
public void OpenInfoModal() { CGPoint orgPoint = Utility.GetModalPanelLocation(); using (NSAutoreleasePool pool = new NSAutoreleasePool()) { using (var infoPanelController = new PublicationInfoPanelController(orgPoint)) { infoPanelController.BookInfo = PublicationsDataManager.SharedInstance.CurrentPubliction; infoPanelController.InitializeInfoView(); var infoPanel = infoPanelController.Window; infoPanel.MakeFirstResponder(null); NSApplication NSApp = NSApplication.SharedApplication; infoPanel.WindowShouldClose += (t) => true; infoPanel.WillClose += delegate(object asender, EventArgs e) { NSApp.StopModal(); }; NSApplication.SharedApplication.RunModalForWindow(infoPanel); infoPanelController.Window.OrderOut(null); infoPanelController.Dispose(); AddInfoUpdateState(); } } }
private async void InfoButtonClick(NSObject sender) { isCanToContent = true; CGPoint orgPoint = Utility.GetModalPanelLocation(690.0f, LNRConstants.WindowHeight_MIN); //658+22 using (var infoPanelController = new PublicationInfoPanelController(orgPoint, this)) { infoController = infoPanelController; infoPanelController.BookInfo = BookInfo; infoPanelController.InitializeInfoView(UpdateStatus); var infoPanel = infoPanelController.Window; infoPanel.MakeFirstResponder(null); NSApplication NSApp = NSApplication.SharedApplication; infoPanel.WindowShouldClose += (t) => true; bool isOpenContentPanel = false; infoPanel.WillClose += delegate(object asender, EventArgs e) { isOpenContentPanel = infoPanelController.IsOpenContentPanel; UpdateStatus = infoPanelController.UpdateStatus; NSApp.StopModal(); }; NSApp.RunModalForWindow(infoPanel); infoPanelController.Window.OrderOut(null); RefreshUpdateStatus(UpdateStatus); if (isOpenContentPanel) { await OpenContentPanel(); } } infoController = null; }
void profileSelected() { if (tableView.SelectedRowCount > 0) { var rowSelected = tableView.SelectedRow; SignedInGamer sig = new SignedInGamer(); sig.DisplayName = gamerList[(int)rowSelected].DisplayName; sig.Gamertag = gamerList[(int)rowSelected].Gamertag; sig.InternalIdentifier = gamerList[(int)rowSelected].PlayerInternalIdentifier; Gamer.SignedInGamers.Add(sig); } MonoGameGamerServicesHelper.SerializeProfiles(gamerList); NSApp.StopModal(); }
void InfoButtonClick(NSObject sender) { isCanToContent = true; isInInfoPanel = true; CGPoint orgPoint = Utility.GetModalPanelLocation(); using (var infoPanelController = new PublicationInfoPanelController(orgPoint, this)) { infoController = infoPanelController; //var infoPanelController = new PublicationInfoPanelController (orgPoint,this); infoPanelController.BookInfo = BookInfo; infoPanelController.InitializeInfoView(); var infoPanel = infoPanelController.Window; infoPanel.MakeFirstResponder(null); NSApplication NSApp = NSApplication.SharedApplication; infoPanel.WindowShouldClose += (t) => true; bool isOpenContentPanel = false; int updateStatus = 0; infoPanel.WillClose += delegate(object asender, EventArgs e) { isOpenContentPanel = infoPanelController.IsOpenContentPanel; updateStatus = infoPanelController.UpdateStatus; NSApp.StopModal(); }; NSApp.RunModalForWindow(infoPanel); infoPanelController.Window.OrderOut(null); if (updateStatus == 1) { UpdateDownloadProgress(); } else if (updateStatus == 2) { RefreshPublicationView(); } if (isOpenContentPanel) { OpenContentPanel(); } } isInInfoPanel = false; infoController = null; }
partial void sheetDone(NSButton sender) { NSApp.StopModal(); }
partial void OkClick(NSObject sender) { //Console.WriteLine("OkClick - exit from Edit"); NSApp.StopModal(); }
//NSMutableCharacterSet password ; /// <summary> /// Button Cancel click /// </summary> /// <param name='sender'> /// Sender. /// </param> partial void cancelClick(NSObject sender) { NSApp.StopModal(); cancelled = true; }