示例#1
0
        /// <summary>
        /// Initialize (in the GUI and syncing mechanism) an existing CmisSync synchronized folder.
        /// </summary>
        /// <param name="repositoryInfo">Synchronized folder path</param>
        private void ConfigureAndStartSyncFolderSyncronization(Config.SyncConfig.SyncFolder repositoryInfo)
        {
            //create the local directory
            System.IO.Directory.CreateDirectory(repositoryInfo.LocalPath);

            CmisSync.Lib.Sync.SyncFolderSyncronizer syncronizer = new CmisSync.Lib.Sync.SyncFolderSyncronizer(repositoryInfo);
            syncronizer.Event += syncronizer_Event;
            this.SyncFolders.Add(syncronizer);
            syncronizer.Initialize();
        }
示例#2
0
 internal void ShowSettingsWindow(SyncFolderSyncronizer syncFolderSyncronizer)
 {
     Views.SettingsWindow w = new Views.SettingsWindow();
     w.DataContext = new SyncFolderSettingsViewModel(this, syncFolderSyncronizer.SyncFolderInfo);
     w.Show();
 }
示例#3
0
 internal void SyncNow(SyncFolderSyncronizer syncFolderSyncronizer)
 {
     Thread t = new Thread(() =>
     {
         syncFolderSyncronizer.Sync();
     });
     t.SetApartmentState(ApartmentState.STA);
     t.Start();
 }
示例#4
0
        public void StopAndRemoveSyncFolderSyncronization(SyncFolderSyncronizer syncFolderSyncronizer, bool? keepLocalFiles = null)
        {
            if (!keepLocalFiles.HasValue)
            {
                MessageBoxResult result = MessageBox.Show("Do you want to also remove local files?", "Local Files", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
                if (result == MessageBoxResult.Yes)
                {
                    keepLocalFiles = false;
                }
                else if (result == MessageBoxResult.No)
                {
                    keepLocalFiles = true;
                }
                else
                {
                    //abort
                    return;
                }
            }

            syncFolderSyncronizer.CancelSyncronization();
            syncFolderSyncronizer.deleteResources(keepLocalFiles.Value);
            ConfigManager.CurrentConfig.RemoveSyncFolder(syncFolderSyncronizer.SyncFolderInfo);
            syncFolderSyncronizer.Dispose();
            this.SyncFolders.Remove(syncFolderSyncronizer);
            Logger.Info("Removed Repository: " + syncFolderSyncronizer.SyncFolderInfo.DisplayName);
        }