public static void SelectFile(NSWindow window, NSTextField field) { NSOpenPanel openPanel = new NSOpenPanel (); openPanel.BeginSheet (window, (i) => { try { if (openPanel.Url != null) { string path = openPanel.Url.Path; if (!string.IsNullOrEmpty (path)) field.StringValue = path; } } finally { openPanel.Dispose (); } }); }
partial void ChangeWatchPath (NSObject sender) { var openPanel = new NSOpenPanel { CanChooseDirectories = true, CanChooseFiles = false }; openPanel.BeginSheet (Window, result => { if (result == 1) { WatchPathTextField.StringValue = openPanel.DirectoryUrl.Path; OnWatchPathChanged (null, null); } }); }
internal void OpenComic(AppDelegate d) { NSOpenPanel openPanel = new NSOpenPanel (); openPanel.AllowedFileTypes = new string[] { "cbr" }; openPanel.BeginSheet (Window, new NSSavePanelComplete (r => TryLoad (d, openPanel.Url))); }