//strongly typed window accessor //public new TableEdit Window { // get { return (TableEdit)base.Window; } //} public NSMutableDictionary edit(NSDictionary startingValues, TestWindowController sender) { NSWindow window = this.Window; cancelled = false; var editFields = editForm.Cells; if (startingValues != null) { savedFields = NSMutableDictionary.FromDictionary(startingValues); editFields[FIRST_NAME].StringValue = startingValues[TestWindowController.FIRST_NAME].ToString(); editFields[LAST_NAME].StringValue = startingValues[TestWindowController.LAST_NAME].ToString(); editFields[PHONE].StringValue = startingValues[TestWindowController.PHONE].ToString(); } else { // we are adding a new entry, // make sure the form fields are empty due to the fact that this controller is recycled // each time the user opens the sheet - editFields[FIRST_NAME].StringValue = string.Empty; editFields[LAST_NAME].StringValue = string.Empty; editFields[PHONE].StringValue = string.Empty; } NSApp.BeginSheet(window,sender.Window); //,null,null,IntPtr.Zero); NSApp.RunModalForWindow(window); // sheet is up here..... // when StopModal is called will continue here .... NSApp.EndSheet(window); window.OrderOut(this); return savedFields; }
//strongly typed window accessor //public new TableEdit Window { // get { return (TableEdit)base.Window; } //} public NSMutableDictionary edit(NSDictionary startingValues, TestWindowController sender) { NSWindow window = this.Window; cancelled = false; var editFields = editForm.Cells; if (startingValues != null) { savedFields = NSMutableDictionary.FromDictionary(startingValues); editFields[FIRST_NAME].StringValue = startingValues[TestWindowController.FIRST_NAME].ToString(); editFields[LAST_NAME].StringValue = startingValues[TestWindowController.LAST_NAME].ToString(); editFields[PHONE].StringValue = startingValues[TestWindowController.PHONE].ToString(); } else { // we are adding a new entry, // make sure the form fields are empty due to the fact that this controller is recycled // each time the user opens the sheet - editFields[FIRST_NAME].StringValue = string.Empty; editFields[LAST_NAME].StringValue = string.Empty; editFields[PHONE].StringValue = string.Empty; } NSApp.BeginSheet(window, sender.Window); //,null,null,IntPtr.Zero); NSApp.RunModalForWindow(window); // sheet is up here..... // when StopModal is called will continue here .... NSApp.EndSheet(window); window.OrderOut(this); return(savedFields); }
public override void DidFinishLaunching (NSNotification notification) { testWindowController = new TestWindowController (); testWindowController.Window.MakeKeyAndOrderFront (this); }
public override void FinishedLaunching(NSObject notification) { testWindowController = new TestWindowController(); testWindowController.Window.MakeKeyAndOrderFront(this); }