Example #1
0
        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");
                    }
                }
            });
        }
Example #2
0
 partial void OnServicesSpotifyForceAuthentication(AppKit.NSMenuItem sender)
 {
     if (Client != null && Client.IsConnected)
     {
         Client.Send(Shared.Protocol.Instruction.OpCode.AUTH_SPOTIFY);
     }
 }
Example #3
0
        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();
 }
Example #5
0
 partial void OnJARVISPreferences(AppKit.NSMenuItem sender)
 {
     ShowPreferencesWindow();
 }
Example #6
0
 partial void OnServerDisconnect(AppKit.NSMenuItem sender)
 {
     Client.Stop();
 }
Example #7
0
 partial void OnServerConnect(AppKit.NSMenuItem sender)
 {
     Client.Start();
 }
Example #8
0
 partial void OnWindowShow(AppKit.NSMenuItem sender)
 {
     ShowMainWindow();
 }
Example #9
0
 public void InsertItematIndex(NSMenuItem newItem, int index)
 {
     InsertItem(newItem, index);
 }
Example #10
0
 partial void newAction(AppKit.NSMenuItem sender)
 {
     ServiceLayer.Instance.Router.ShowNewItem();
 }
Example #11
0
 partial void aboutAction(AppKit.NSMenuItem sender)
 {
     ServiceLayer.Instance.Router.ShowAbout();
 }