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