private void ApplyNewConfiguration(Configuration configuration)
        {
            this.notifyIconManager.MinimizeToTray = configuration.MinimizeToTray;
            this.notifyIconManager.CloseToTray = configuration.CloseToTray;
            this.notifyIconManager.ShowOnlyOnClose = configuration.ShowTrayIconOnlyOnClose;
            this.notifyIconManager.FolderNotificationsEnabled = configuration.Folders.ToDictionary(x => x.ID, x => x.NotificationsEnabled);
            this.notifyIconManager.ShowSynchronizedBalloonEvenIfNothingDownloaded = configuration.ShowSynchronizedBalloonEvenIfNothingDownloaded;
            this.notifyIconManager.ShowDeviceConnectivityBalloons = configuration.ShowDeviceConnectivityBalloons;

            this.syncThingManager.PreferredAddress = new Uri("https://" + configuration.SyncthingAddress);
            this.syncThingManager.ApiKey = configuration.SyncthingApiKey;
            this.syncThingManager.SyncthingCommandLineFlags = configuration.SyncthingCommandLineFlags;
            this.syncThingManager.SyncthingEnvironmentalVariables = configuration.SyncthingEnvironmentalVariables;
            this.syncThingManager.SyncthingCustomHomeDir = configuration.SyncthingUseCustomHome ?
                EnvVarTransformer.Transform(configuration.SyncthingCustomHomePath)
                : null;
            this.syncThingManager.SyncthingDenyUpgrade = configuration.SyncthingDenyUpgrade;
            this.syncThingManager.SyncthingPriorityLevel = configuration.SyncthingPriorityLevel;
            this.syncThingManager.SyncthingHideDeviceIds = configuration.ObfuscateDeviceIDs;
            this.syncThingManager.ExecutablePath = EnvVarTransformer.Transform(configuration.SyncthingPath);

            this.watchedFolderMonitor.WatchedFolderIDs = configuration.Folders.Where(x => x.IsWatched).Select(x => x.ID);

            this.updateManager.LatestIgnoredVersion = configuration.LatestNotifiedVersion;
            this.updateManager.CheckForUpdates = configuration.NotifyOfNewVersions;
        }
예제 #2
0
 private void SetCulture(Configuration configuration)
 {
     lock (this.cultureLock)
     {
         this.culture = configuration.UseComputerCulture ? Thread.CurrentThread.CurrentUICulture : null;
     }
 }
예제 #3
0
 public Configuration(Configuration other)
 {
     this.ShowTrayIconOnlyOnClose = other.ShowTrayIconOnlyOnClose;
     this.MinimizeToTray = other.MinimizeToTray;
     this.CloseToTray = other.CloseToTray;
     this.ShowSynchronizedBalloonEvenIfNothingDownloaded = other.ShowSynchronizedBalloonEvenIfNothingDownloaded;
     this.ShowDeviceConnectivityBalloons = other.ShowDeviceConnectivityBalloons;
     this.SyncthingAddress = other.SyncthingAddress;
     this.StartSyncthingAutomatically = other.StartSyncthingAutomatically;
     this.SyncthingApiKey = other.SyncthingApiKey;
     this.SyncthingCommandLineFlags = other.SyncthingCommandLineFlags;
     this.SyncthingEnvironmentalVariables = other.SyncthingEnvironmentalVariables;
     this.SyncthingUseCustomHome = other.SyncthingUseCustomHome;
     this.SyncthingDenyUpgrade = other.SyncthingDenyUpgrade;
     this.SyncthingPriorityLevel = other.SyncthingPriorityLevel;
     this.Folders = other.Folders.Select(x => new FolderConfiguration(x)).ToList();
     this.NotifyOfNewVersions = other.NotifyOfNewVersions;
     this.ObfuscateDeviceIDs = other.ObfuscateDeviceIDs;
     this.LatestNotifiedVersion = other.LatestNotifiedVersion;
     this.UseComputerCulture = other.UseComputerCulture;
     this.SyncthingConsoleHeight = other.SyncthingConsoleHeight;
     this.WindowPlacement = other.WindowPlacement;
     this.SyncthingWebBrowserZoomLevel = other.SyncthingWebBrowserZoomLevel;
     this.LastSeenInstallCount = other.LastSeenInstallCount;
     this.SyncthingPath = other.SyncthingPath;
     this.SyncthingCustomHomePath = other.SyncthingCustomHomePath;
     this.DisableHardwareRendering = other.DisableHardwareRendering;
     this.EnableFailedTransferAlerts = other.EnableFailedTransferAlerts;
     this.EnableConflictFileMonitoring = other.EnableConflictFileMonitoring;
     this.SyncthingDebugFacilities = other.SyncthingDebugFacilities;
     this.ConflictResolverDeletesToRecycleBin = other.ConflictResolverDeletesToRecycleBin;
     this.PauseDevicesOnMeteredNetworks = other.PauseDevicesOnMeteredNetworks;
 }
예제 #4
0
 public abstract void SaveValue(Configuration configuration);
예제 #5
0
 public abstract void LoadValue(Configuration configuration);
예제 #6
0
        private void LoadFolders(Configuration configuration)
        {
            var folderIds = this.syncthingManager.Folders.FetchAll().Select(x => x.FolderId).ToList();

            foreach (var newKey in folderIds.Except(configuration.Folders.Select(x => x.ID)))
            {
                configuration.Folders.Add(new FolderConfiguration(newKey, true, true));
            }

            configuration.Folders = configuration.Folders.Where(x => folderIds.Contains(x.ID)).ToList();
        }