partial void onClickSetHugoFolder(AppKit.NSMenuItem sender) { var openPanel = NSOpenPanel.OpenPanel; openPanel.Title = "Choose Your Hugo Root Folder"; openPanel.CanChooseFiles = false; openPanel.CanChooseDirectories = true; openPanel.BeginSheet(NSApplication.SharedApplication.KeyWindow, result => { if (result == 1) { var path = openPanel.DirectoryUrl.Path; var contentPath = Constants.hugoContentPath; if (Directory.Exists(contentPath)) { Console.WriteLine(openPanel.DirectoryUrl.Path); Console.WriteLine("all good: " + contentPath); Constants.hugoProjectPath = path; NSUserDefaults.StandardUserDefaults.Synchronize(); viewController.reloadDataSource(); } else { showAlert("This does not appear to be a Hugo blog.", "Invalid Directory"); } } }); }
partial void OnServicesSpotifyForceAuthentication(AppKit.NSMenuItem sender) { if (Client != null && Client.IsConnected) { Client.Send(Shared.Protocol.Instruction.OpCode.AUTH_SPOTIFY); } }
partial void MenuNewWindowClicked(AppKit.NSMenuItem sender) { // Get new window var storyboard = NSStoryboard.FromName("Main", null); var controller = storyboard.InstantiateControllerWithIdentifier("MainWindow") as NSWindowController; // Display controller.ShowWindow(this); }
partial void MenuItemUpdateClick(AppKit.NSMenuItem sender) { ViewController?.ShowMouseState(); }
partial void OnJARVISPreferences(AppKit.NSMenuItem sender) { ShowPreferencesWindow(); }
partial void OnServerDisconnect(AppKit.NSMenuItem sender) { Client.Stop(); }
partial void OnServerConnect(AppKit.NSMenuItem sender) { Client.Start(); }
partial void OnWindowShow(AppKit.NSMenuItem sender) { ShowMainWindow(); }
public void InsertItematIndex(NSMenuItem newItem, int index) { InsertItem(newItem, index); }
partial void newAction(AppKit.NSMenuItem sender) { ServiceLayer.Instance.Router.ShowNewItem(); }
partial void aboutAction(AppKit.NSMenuItem sender) { ServiceLayer.Instance.Router.ShowAbout(); }