/// <summary> /// Add a synchronized folder to the configuration. /// </summary> public void AddFolder(RepoInfo repoInfo) { if (null == repoInfo) { return; } SyncConfig.Folder folder = new SyncConfig.Folder() { DisplayName = repoInfo.Name, LocalPath = repoInfo.TargetDirectory, IgnoredFolders = new List <IgnoredFolder>(), RemoteUrl = repoInfo.Address, RepositoryId = repoInfo.RepoID, RemotePath = repoInfo.RemotePath, UserName = repoInfo.User, ObfuscatedPassword = repoInfo.Password.ObfuscatedPassword, PollInterval = repoInfo.PollInterval, IsSuspended = repoInfo.IsSuspended, SyncAtStartup = repoInfo.SyncAtStartup, SupportedFeatures = null }; foreach (string ignoredFolder in repoInfo.getIgnoredPaths()) { folder.IgnoredFolders.Add(new IgnoredFolder() { Path = ignoredFolder }); } this.configXml.Folders.Add(folder); Save(); }
/// <summary> /// Add a synchronized folder to the configuration. /// </summary> public void AddFolder(RepoInfo repoInfo) { if (null == repoInfo) { return; } this.AddFolder(repoInfo.Name, repoInfo.TargetDirectory, repoInfo.Address, repoInfo.RepoID, repoInfo.RemotePath, repoInfo.User, repoInfo.Password, repoInfo.PollInterval, repoInfo.getIgnoredPaths()); }
/// <summary> /// Add a synchronized folder to the configuration. /// </summary> public void AddFolder(RepoInfo repoInfo) { if (null == repoInfo) { return; } SyncConfig.Folder folder = new SyncConfig.Folder() { DisplayName = repoInfo.Name, LocalPath = repoInfo.TargetDirectory, IgnoredFolders = new List<IgnoredFolder>(), RemoteUrl = repoInfo.Address, RepositoryId = repoInfo.RepoID, RemotePath = repoInfo.RemotePath, UserName = repoInfo.User, ObfuscatedPassword = repoInfo.Password.ObfuscatedPassword, PollInterval = repoInfo.PollInterval }; foreach (string ignoredFolder in repoInfo.getIgnoredPaths()) { folder.IgnoredFolders.Add(new IgnoredFolder(){Path = ignoredFolder}); } this.configXml.Folders.Add(folder); Save(); }