Ejemplo n.º 1
0
        partial void SetSyncPath(NSObject sender)
        {
            var openPanel = new NSOpenPanel();

            openPanel.ReleasedWhenClosed   = true;
            openPanel.CanChooseDirectories = true;
            openPanel.CanChooseFiles       = false;
            openPanel.CanCreateDirectories = true;
            openPanel.Prompt = "Select Directory";

            var result = openPanel.RunModal();

            if (result == 1)
            {
                SyncPathTextField.Cell.Title = openPanel.DirectoryUrl.Path;
                //AppDelegate.FilesystemSyncPath = openPanel.DirectoryUrl.Path;

                AppDelegate.settings.syncURL = openPanel.DirectoryUrl.Path;
                SettingsSync.Write(AppDelegate.settings);

                NSAlert alert = new NSAlert()
                {
                    MessageText     = "File System Sync",
                    InformativeText = "File System Sync path has been set at:\n" + AppDelegate.settings.syncURL,
                    AlertStyle      = NSAlertStyle.Warning
                };
                alert.AddButton("OK");
                alert.BeginSheet(this.Window,
                                 this,
                                 null,
                                 IntPtr.Zero);
            }
        }
Ejemplo n.º 2
0
        partial void EnableAutoSyncingAction(NSObject sender)
        {
            if (EnableAutoSyncing.Enabled)
            {
                AppDelegate.settings.autoSync = true;
            }
            else
            {
                AppDelegate.settings.autoSync = false;
            }

            SettingsSync.Write(AppDelegate.settings);
            //Console.WriteLine("Enabled Auto Sync - ");
            //Console.WriteLine(AppDelegate.settings.autoSync.ToString());
        }