Beispiel #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);
            }
        }
Beispiel #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());
        }
Beispiel #3
0
        internal VsVimHost(
            IVsAdapter adapter,
            ITextBufferFactoryService textBufferFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            ITextDocumentFactoryService textDocumentFactoryService,
            ITextBufferUndoManagerProvider undoManagerProvider,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
            IEditorOperationsFactoryService editorOperationsFactoryService,
            ISmartIndentationService smartIndentationService,
            ITextManager textManager,
            ISharedServiceFactory sharedServiceFactory,
            IVimApplicationSettings vimApplicationSettings,
            IExtensionAdapterBroker extensionAdapterBroker,
            IProtectedOperations protectedOperations,
            IMarkDisplayUtil markDisplayUtil,
            IControlCharUtil controlCharUtil,
            ICommandDispatcher commandDispatcher,
            SVsServiceProvider serviceProvider,
            IClipboardDevice clipboardDevice)
            : base(textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService)
        {
            _vsAdapter = adapter;
            _editorAdaptersFactoryService = editorAdaptersFactoryService;
            _dte                     = (_DTE)serviceProvider.GetService(typeof(_DTE));
            _vsExtensibility         = (IVsExtensibility)serviceProvider.GetService(typeof(IVsExtensibility));
            _textManager             = textManager;
            _sharedService           = sharedServiceFactory.Create();
            _vsMonitorSelection      = serviceProvider.GetService <SVsShellMonitorSelection, IVsMonitorSelection>();
            _vimApplicationSettings  = vimApplicationSettings;
            _smartIndentationService = smartIndentationService;
            _extensionAdapterBroker  = extensionAdapterBroker;
            _runningDocumentTable    = serviceProvider.GetService <SVsRunningDocumentTable, IVsRunningDocumentTable>();
            _vsShell                 = (IVsShell)serviceProvider.GetService(typeof(SVsShell));
            _protectedOperations     = protectedOperations;
            _commandDispatcher       = commandDispatcher;
            _clipboardDevice         = clipboardDevice;

            _vsMonitorSelection.AdviseSelectionEvents(this, out uint selectionCookie);
            _runningDocumentTable.AdviseRunningDocTableEvents(this, out uint runningDocumentTableCookie);

            InitOutputPane();

            _settingsSync = new SettingsSync(vimApplicationSettings, markDisplayUtil, controlCharUtil, _clipboardDevice);
            _settingsSync.SyncFromApplicationSettings();
        }
Beispiel #4
0
        public AppDelegate()
        {
            var storage_path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "Library", "Application Support", "Tomboy");

            // TODO, set it in a generic way
            noteStorage = new DiskStorage(storage_path);
            noteStorage.SetBackupPath(backupPathUri);

            if (!Directory.Exists(backupPathUri))
            {
                noteStorage.Backup(); //FIXME: Need to better handle status messages.
            }
            Logger.Debug("Backup Path set to {0}", backupPathUri);

            NoteEngine = new Engine(noteStorage);

            // keep track of note for syncing
            // TODO move this into an Add-in one day
            var manifest_path = Path.Combine(storage_path, "manifest.xml");

            manifestTracker = new ManifestTracker(NoteEngine, manifest_path);

            // Create our cache directory
            if (!Directory.Exists(BaseUrlPath))
            {
                Directory.CreateDirectory(BaseUrlPath);
            }

            // Currently lazy load because otherwise the Dock Menu throws an error about there being no notes.
            if (Notes == null)
            {
                Notes = NoteEngine.GetNotes();
            }

            NoteEngine.NoteAdded   += HandleNoteAdded;
            NoteEngine.NoteRemoved += HandleNoteRemoved;
            NoteEngine.NoteUpdated += HandleNoteUpdated;

            settings = SettingsSync.Read();
        }