nint OpenPanel(bool chooseFiles, bool chooseDirectories, out string dir) { nint res = 1; var openPanel = new NSOpenPanel { CanChooseFiles = chooseFiles, CanChooseDirectories = chooseDirectories, }; NSWindow window = new NSWindow { }; openPanel.BeginSheet(window, result => { window.EndSheet(window); res = result; }); if (res == 1) { dir = openPanel.DirectoryUrl.Path; } else { dir = ""; } return(res); }
private void Hide(bool isCancelled) { this.IsShowing = false; NSApplication.SharedApplication.InvokeOnMainThread(() => { mainWindow.EndSheet(this.progressPanel, isCancelled ? NSModalResponse.Cancel : NSModalResponse.OK); }); }
public static void ShowGenericWindowAsSheet(string content, string title, NSWindow parentWindow) { UIErrorHelper.CheckedExec(delegate() { GenericTextViewWindowController gwc = new GenericTextViewWindowController(content); gwc.Window.Title = title; NSApplication.SharedApplication.BeginSheet(gwc.Window, parentWindow, () => { }); NSApplication.SharedApplication.RunModalForWindow(gwc.Window); parentWindow.EndSheet(gwc.Window); gwc.Dispose(); }); }
public void DismissMessage(int messageId) { NSAlert alert; if (alerts.TryGetValue(messageId, out alert)) { alerts.Remove(messageId); window.EndSheet(alert.Window); alert.Window.OrderOut(null); alert.Dispose(); } }
public static void ShowGenericWindowAsSheet (string content, string title, NSWindow parentWindow) { UIErrorHelper.CheckedExec (delegate () { GenericTextViewWindowController gwc = new GenericTextViewWindowController (content); gwc.Window.Title = title; NSApplication.SharedApplication.BeginSheet (gwc.Window, parentWindow, () => { }); NSApplication.SharedApplication.RunModalForWindow (gwc.Window); parentWindow.EndSheet (gwc.Window); gwc.Dispose (); }); }
nint SavePanel(out string target) { nint res = 1; var savePanel = new NSSavePanel { }; NSWindow window = new NSWindow { }; savePanel.BeginSheet(window, (result) => { window.EndSheet(window); res = result; }); if (res == 1) { target = savePanel.Url.Path; } else { target = ""; } return(res); }