public virtual void UpdateSettings(string password, int pollInterval, bool syncAtStartup)
{
//Get configuration
Config config = ConfigManager.CurrentConfig;
CmisSync.Lib.Config.SyncConfig.Folder syncConfig = config.GetFolder(this.Name);
//Pause sync
this.remote_timer.Stop();
if (Enabled)
{
Disable();
}
//Update password...
if (!String.IsNullOrEmpty(password))
{
this.RepoInfo.Password = new Password(password.TrimEnd());
syncConfig.ObfuscatedPassword = RepoInfo.Password.ObfuscatedPassword;
Logger.Debug("Updated \"" + this.Name + "\" password");
}
// Sync at startup
syncConfig.SyncAtStartup = syncAtStartup;
//Update poll interval
this.RepoInfo.PollInterval = pollInterval;
this.remote_timer.Interval = pollInterval;
syncConfig.PollInterval = pollInterval;
Logger.Debug("Updated \"" + this.Name + "\" poll interval: " + pollInterval);
//Save configuration
config.Save();
//Always resume sync...
Enable();
this.remote_timer.Start();
}