/// <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); }
/// <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); }