コード例 #1
0
        /// <summary>
        /// Remove a synchronized folder from the CmisSync configuration.
        /// This happens after the user removes the folder.
        /// </summary>
        /// <param name="folder">The synchronized folder to remove</param>
        private void RemoveRepository(Config.SyncConfig.Folder folder)
        {
            if (this.repositories.Count > 0)
            {
                for (int i = 0; i < this.repositories.Count; i++)
                {
                    RepoBase repo = this.repositories[i];

                    if (repo.LocalPath.Equals(folder.LocalPath))
                    {
                        repo.CancelSync();
                        repo.Dispose();
                        this.repositories.Remove(repo);
                        Logger.Info("Removed Repository: " + repo.Name);
                        repo = null;
                        break;
                    }
                }
            }
            // Remove Cmis Database File
            string dbfilename = folder.DisplayName;

            dbfilename = dbfilename.Replace("\\", "_");
            dbfilename = dbfilename.Replace("/", "_");
            RemoveDatabase(dbfilename);
        }
コード例 #2
0
ファイル: ControllerBase.cs プロジェクト: to2y/CmisSync
        /// <summary>
        /// Remove a synchronized folder from the CmisSync configuration.
        /// This happens after the user removes the folder.
        /// </summary>
        /// <param name="folder_path">The synchronized folder to remove</param>
        private void RemoveRepository(string folder_path)
        {
            if (this.repositories.Count > 0)
            {
                for (int i = 0; i < this.repositories.Count; i++)
                {
                    RepoBase repo = this.repositories[i];

                    if (repo.LocalPath.Equals(folder_path))
                    {
                        // Remove Cmis Database File
                        RemoveDatabase(folder_path);

                        repo.Dispose();
                        this.repositories.Remove(repo);
                        repo = null;

                        return;
                    }
                }
            }

            RemoveDatabase(folder_path);
        }