Example #1
0
        public ConfigurationApplicator(
            IConfigurationProvider configurationProvider,
            IApplicationPathsProvider pathsProvider,
            INotifyIconManager notifyIconManager,
            ISyncthingManager syncthingManager,
            IAutostartProvider autostartProvider,
            IWatchedFolderMonitor watchedFolderMonitor,
            IUpdateManager updateManager,
            IConflictFileWatcher conflictFileWatcher,
            IAlertsManager alertsManager,
            IMeteredNetworkManager meteredNetworkManager,
            IPathTransformer pathTransformer)
        {
            this.configurationProvider = configurationProvider;
            this.configurationProvider.ConfigurationChanged += this.ConfigurationChanged;

            this.pathsProvider         = pathsProvider;
            this.notifyIconManager     = notifyIconManager;
            this.syncthingManager      = syncthingManager;
            this.autostartProvider     = autostartProvider;
            this.watchedFolderMonitor  = watchedFolderMonitor;
            this.updateManager         = updateManager;
            this.conflictFileWatcher   = conflictFileWatcher;
            this.alertsManager         = alertsManager;
            this.meteredNetworkManager = meteredNetworkManager;
            this.pathTransformer       = pathTransformer;

            this.syncthingManager.Folders.FoldersChanged += this.FoldersChanged;
            this.updateManager.VersionIgnored            += this.VersionIgnored;
        }
        public ViewerViewModel(
            IWindowManager windowManager,
            ISyncThingManager syncThingManager,
            IConfigurationProvider configurationProvider,
            IProcessStartProvider processStartProvider,
            IApplicationPathsProvider pathsProvider)
        {
            this.windowManager = windowManager;
            this.syncThingManager = syncThingManager;
            this.processStartProvider = processStartProvider;
            this.configurationProvider = configurationProvider;
            this.pathsProvider = pathsProvider;

            var configuration = this.configurationProvider.Load();
            this.zoomLevel = configuration.SyncthingWebBrowserZoomLevel;

            this.syncThingManager.StateChanged += (o, e) =>
            {
                this.syncThingState = e.NewState;
                this.RefreshBrowser();
            };

            this.callback = new JavascriptCallbackObject(this.OpenFolder);

            this.Bind(x => x.WebBrowser, (o, e) =>
            {
                if (e.NewValue != null)
                    this.InitializeBrowser(e.NewValue);
            });

            this.SetCulture(configuration);
            configurationProvider.ConfigurationChanged += (o, e) => this.SetCulture(e.NewConfiguration);
        }
        public ConfigurationApplicator(
            IConfigurationProvider configurationProvider,
            IApplicationPathsProvider pathsProvider,
            INotifyIconManager notifyIconManager,
            ISyncthingManager syncthingManager,
            IAutostartProvider autostartProvider,
            IWatchedFolderMonitor watchedFolderMonitor,
            IUpdateManager updateManager,
            IConflictFileWatcher conflictFileWatcher,
            IAlertsManager alertsManager,
            IMeteredNetworkManager meteredNetworkManager)
        {
            this.configurationProvider = configurationProvider;
            this.configurationProvider.ConfigurationChanged += this.ConfigurationChanged;

            this.pathsProvider = pathsProvider;
            this.notifyIconManager = notifyIconManager;
            this.syncthingManager = syncthingManager;
            this.autostartProvider = autostartProvider;
            this.watchedFolderMonitor = watchedFolderMonitor;
            this.updateManager = updateManager;
            this.conflictFileWatcher = conflictFileWatcher;
            this.alertsManager = alertsManager;
            this.meteredNetworkManager = meteredNetworkManager;

            this.syncthingManager.DataLoaded += this.OnDataLoaded;
            this.updateManager.VersionIgnored += this.VersionIgnored;
        }
        public UnhandledExceptionViewModel(IApplicationPathsProvider applicationPathsProvider, IProcessStartProvider processStartProvider)
        {
            this.processStartProvider = processStartProvider;

            this.IssuesUrl   = Settings.Default.IssuesUrl;
            this.LogFilePath = applicationPathsProvider.LogFilePath;
        }
        public UnhandledExceptionViewModel(IApplicationPathsProvider applicationPathsProvider, IProcessStartProvider processStartProvider, IAssemblyProvider assemblyProvider)
        {
            this.applicationPathsProvider = applicationPathsProvider;
            this.processStartProvider = processStartProvider;
            this.assemblyProvider = assemblyProvider;

            this.IssuesUrl = AppSettings.Instance.IssuesUrl;
        }
        public UnhandledExceptionViewModel(IApplicationPathsProvider applicationPathsProvider, IProcessStartProvider processStartProvider, IAssemblyProvider assemblyProvider)
        {
            this.processStartProvider = processStartProvider;
            this.assemblyProvider = assemblyProvider;

            this.IssuesUrl = Properties.Settings.Default.IssuesUrl;
            this.LogFilePath = applicationPathsProvider.LogFilePath;
        }
Example #7
0
        public UnhandledExceptionViewModel(IApplicationPathsProvider applicationPathsProvider, IProcessStartProvider processStartProvider, IAssemblyProvider assemblyProvider)
        {
            this.applicationPathsProvider = applicationPathsProvider;
            this.processStartProvider     = processStartProvider;
            this.assemblyProvider         = assemblyProvider;

            this.IssuesUrl = AppSettings.Instance.IssuesUrl;
        }
        public ConfigurationProvider(IApplicationPathsProvider paths)
        {
            this.paths           = paths;
            this.eventDispatcher = new SynchronizedEventDispatcher(this);

            this.migrations = new Func <XDocument, XDocument>[]
            {
                this.MigrateV1ToV2,
                this.MigrateV2ToV3,
            };
        }
        public ConfigurationProvider(IApplicationPathsProvider paths, IFilesystemProvider filesystemProvider)
        {
            this.paths           = paths;
            this.filesystem      = filesystemProvider;
            this.eventDispatcher = new SynchronizedEventDispatcher(this);

            this.migrations = new Func <XDocument, XDocument>[]
            {
                this.MigrateV1ToV2,
                this.MigrateV2ToV3,
                this.MigrateV3ToV4,
                this.MigrateV4ToV5,
            };
        }
 public PortableUpdateVariantHandler(
     IUpdateDownloader updateDownloader,
     IProcessStartProvider processStartProvider,
     IFilesystemProvider filesystem,
     IApplicationPathsProvider pathsProvider,
     IAssemblyProvider assemblyProvider,
     IApplicationState applicationState)
 {
     this.updateDownloader = updateDownloader;
     this.processStartProvider = processStartProvider;
     this.filesystem = filesystem;
     this.pathsProvider = pathsProvider;
     this.assemblyProvider = assemblyProvider;
     this.applicationState = applicationState;
 }
Example #11
0
 public PortableUpdateVariantHandler(
     IUpdateDownloader updateDownloader,
     IProcessStartProvider processStartProvider,
     IFilesystemProvider filesystem,
     IApplicationPathsProvider pathsProvider,
     IAssemblyProvider assemblyProvider,
     IApplicationState applicationState)
 {
     this.updateDownloader     = updateDownloader;
     this.processStartProvider = processStartProvider;
     this.filesystem           = filesystem;
     this.pathsProvider        = pathsProvider;
     this.assemblyProvider     = assemblyProvider;
     this.applicationState     = applicationState;
 }
Example #12
0
        public ConfigurationProvider(IApplicationPathsProvider paths, IFilesystemProvider filesystemProvider, IPathTransformer pathTransformer)
        {
            this.paths           = paths;
            this.filesystem      = filesystemProvider;
            this.pathTransformer = pathTransformer;
            this.eventDispatcher = new SynchronizedEventDispatcher(this);

            this.migrations = new Func <XDocument, XDocument>[]
            {
                this.MigrateV1ToV2,
                this.MigrateV2ToV3,
                this.MigrateV3ToV4,
                this.MigrateV4ToV5,
                this.MigrateV5ToV6,
                this.MigrateV6ToV7,
                this.MigrateV7ToV8,
                this.MigrateV8ToV9,
                this.MigrateV9ToV10,
            };
        }
        public ConfigurationApplicator(
            IConfigurationProvider configurationProvider,
            IApplicationPathsProvider pathsProvider,
            INotifyIconManager notifyIconManager,
            ISyncThingManager syncThingManager,
            IAutostartProvider autostartProvider,
            IWatchedFolderMonitor watchedFolderMonitor,
            IUpdateManager updateManager)
        {
            this.configurationProvider = configurationProvider;
            this.configurationProvider.ConfigurationChanged += (o, e) => this.ApplyNewConfiguration(e.NewConfiguration);

            this.pathsProvider = pathsProvider;
            this.notifyIconManager = notifyIconManager;
            this.syncThingManager = syncThingManager;
            this.autostartProvider = autostartProvider;
            this.watchedFolderMonitor = watchedFolderMonitor;
            this.updateManager = updateManager;

            this.syncThingManager.DataLoaded += (o, e) => this.LoadFolders();
            this.updateManager.VersionIgnored += (o, e) => this.configurationProvider.AtomicLoadAndSave(config => config.LatestNotifiedVersion = e.IgnoredVersion);
        }
        public ConfigurationApplicator(
            IConfigurationProvider configurationProvider,
            IApplicationPathsProvider pathsProvider,
            INotifyIconManager notifyIconManager,
            ISyncThingManager syncThingManager,
            IAutostartProvider autostartProvider,
            IWatchedFolderMonitor watchedFolderMonitor,
            IUpdateManager updateManager)
        {
            this.configurationProvider = configurationProvider;
            this.configurationProvider.ConfigurationChanged += (o, e) => this.ApplyNewConfiguration(e.NewConfiguration);

            this.pathsProvider        = pathsProvider;
            this.notifyIconManager    = notifyIconManager;
            this.syncThingManager     = syncThingManager;
            this.autostartProvider    = autostartProvider;
            this.watchedFolderMonitor = watchedFolderMonitor;
            this.updateManager        = updateManager;

            this.syncThingManager.DataLoaded  += (o, e) => this.LoadFolders();
            this.updateManager.VersionIgnored += (o, e) => this.configurationProvider.AtomicLoadAndSave(config => config.LatestNotifiedVersion = e.IgnoredVersion);
        }
Example #15
0
        public ViewerViewModel(
            IWindowManager windowManager,
            ISyncthingManager syncthingManager,
            IConfigurationProvider configurationProvider,
            IProcessStartProvider processStartProvider,
            IApplicationPathsProvider pathsProvider)
        {
            this.windowManager = windowManager;
            this.syncthingManager = syncthingManager;
            this.processStartProvider = processStartProvider;
            this.configurationProvider = configurationProvider;
            this.pathsProvider = pathsProvider;

            var configuration = this.configurationProvider.Load();
            this.zoomLevel = configuration.SyncthingWebBrowserZoomLevel;

            this.syncthingManager.StateChanged += this.SyncthingStateChanged;

            this.callback = new JavascriptCallbackObject(this.OpenFolder, this.BrowseFolderPath);

            this.SetCulture(configuration);
            configurationProvider.ConfigurationChanged += this.ConfigurationChanged;
        }
Example #16
0
        public ViewerViewModel(
            IWindowManager windowManager,
            ISyncThingManager syncThingManager,
            IConfigurationProvider configurationProvider,
            IProcessStartProvider processStartProvider,
            IApplicationPathsProvider pathsProvider)
        {
            this.windowManager         = windowManager;
            this.syncThingManager      = syncThingManager;
            this.processStartProvider  = processStartProvider;
            this.configurationProvider = configurationProvider;
            this.pathsProvider         = pathsProvider;

            var configuration = this.configurationProvider.Load();

            this.zoomLevel = configuration.SyncthingWebBrowserZoomLevel;

            this.syncThingManager.StateChanged += (o, e) =>
            {
                this.syncThingState = e.NewState;
                this.RefreshBrowser();
            };

            this.callback = new JavascriptCallbackObject(this.OpenFolder);

            this.Bind(x => x.WebBrowser, (o, e) =>
            {
                if (e.NewValue != null)
                {
                    this.InitializeBrowser(e.NewValue);
                }
            });

            this.SetCulture(configuration);
            configurationProvider.ConfigurationChanged += (o, e) => this.SetCulture(e.NewConfiguration);
        }
Example #17
0
        public ViewerViewModel(
            IWindowManager windowManager,
            ISyncthingManager syncthingManager,
            IConfigurationProvider configurationProvider,
            IProcessStartProvider processStartProvider,
            IApplicationPathsProvider pathsProvider)
        {
            this.windowManager         = windowManager;
            this.syncthingManager      = syncthingManager;
            this.processStartProvider  = processStartProvider;
            this.configurationProvider = configurationProvider;
            this.pathsProvider         = pathsProvider;

            var configuration = this.configurationProvider.Load();

            this.zoomLevel = configuration.SyncthingWebBrowserZoomLevel;

            this.syncthingManager.StateChanged += this.SyncthingStateChanged;

            this.callback = new JavascriptCallbackObject(this.OpenFolder, this.BrowseFolderPath);

            this.SetCulture(configuration);
            configurationProvider.ConfigurationChanged += this.ConfigurationChanged;
        }
Example #18
0
        public SettingsViewModel(
            IConfigurationProvider configurationProvider,
            IAutostartProvider autostartProvider,
            IWindowManager windowManager,
            IProcessStartProvider processStartProvider,
            IAssemblyProvider assemblyProvider,
            IApplicationState applicationState,
            IApplicationPathsProvider applicationPathsProvider,
            ISyncthingManager syncthingManager,
            IMeteredNetworkManager meteredNetworkManager)
        {
            this.configurationProvider    = configurationProvider;
            this.autostartProvider        = autostartProvider;
            this.windowManager            = windowManager;
            this.processStartProvider     = processStartProvider;
            this.assemblyProvider         = assemblyProvider;
            this.applicationState         = applicationState;
            this.applicationPathsProvider = applicationPathsProvider;
            this.syncthingManager         = syncthingManager;

            this.MinimizeToTray      = this.CreateBasicSettingItem(x => x.MinimizeToTray);
            this.NotifyOfNewVersions = this.CreateBasicSettingItem(x => x.NotifyOfNewVersions);
            this.CloseToTray         = this.CreateBasicSettingItem(x => x.CloseToTray);
            this.ObfuscateDeviceIDs  = this.CreateBasicSettingItem(x => x.ObfuscateDeviceIDs);
            this.UseComputerCulture  = this.CreateBasicSettingItem(x => x.UseComputerCulture);
            this.UseComputerCulture.RequiresSyncTrayzorRestart = true;
            this.DisableHardwareRendering = this.CreateBasicSettingItem(x => x.DisableHardwareRendering);
            this.DisableHardwareRendering.RequiresSyncTrayzorRestart = true;
            this.EnableConflictFileMonitoring = this.CreateBasicSettingItem(x => x.EnableConflictFileMonitoring);
            this.EnableFailedTransferAlerts   = this.CreateBasicSettingItem(x => x.EnableFailedTransferAlerts);

            this.PauseDevicesOnMeteredNetworks          = this.CreateBasicSettingItem(x => x.PauseDevicesOnMeteredNetworks);
            this.PauseDevicesOnMeteredNetworksSupported = meteredNetworkManager.IsSupportedByWindows;

            this.ShowTrayIconOnlyOnClose = this.CreateBasicSettingItem(x => x.ShowTrayIconOnlyOnClose);
            this.ShowSynchronizedBalloonEvenIfNothingDownloaded = this.CreateBasicSettingItem(x => x.ShowSynchronizedBalloonEvenIfNothingDownloaded);
            this.ShowDeviceConnectivityBalloons     = this.CreateBasicSettingItem(x => x.ShowDeviceConnectivityBalloons);
            this.ShowDeviceOrFolderRejectedBalloons = this.CreateBasicSettingItem(x => x.ShowDeviceOrFolderRejectedBalloons);

            this.IconAnimationModes = new BindableCollection <LabelledValue <IconAnimationMode> >()
            {
                LabelledValue.Create(Resources.SettingsView_TrayIconAnimation_DataTransferring, Services.Config.IconAnimationMode.DataTransferring),
                LabelledValue.Create(Resources.SettingsView_TrayIconAnimation_Syncing, Services.Config.IconAnimationMode.Syncing),
                LabelledValue.Create(Resources.SettingsView_TrayIconAnimation_Disabled, Services.Config.IconAnimationMode.Disabled),
            };
            this.IconAnimationMode = this.CreateBasicSettingItem(x => x.IconAnimationMode);

            this.StartSyncthingAutomatically = this.CreateBasicSettingItem(x => x.StartSyncthingAutomatically);
            this.SyncthingPriorityLevel      = this.CreateBasicSettingItem(x => x.SyncthingPriorityLevel);
            this.SyncthingPriorityLevel.RequiresSyncthingRestart = true;
            this.SyncthingAddress = this.CreateBasicSettingItem(x => x.SyncthingAddress, new SyncthingAddressValidator());
            this.SyncthingAddress.RequiresSyncthingRestart = true;

            this.CanReadAutostart  = this.autostartProvider.CanRead;
            this.CanWriteAutostart = this.autostartProvider.CanWrite;
            if (this.autostartProvider.CanRead)
            {
                var currentSetup = this.autostartProvider.GetCurrentSetup();
                this.StartOnLogon   = currentSetup.AutoStart;
                this.StartMinimized = currentSetup.StartMinimized;
            }

            this.SyncthingCommandLineFlags = this.CreateBasicSettingItem(
                x => String.Join(" ", x.SyncthingCommandLineFlags),
                (x, v) =>
            {
                IEnumerable <KeyValuePair <string, string> > envVars;
                KeyValueStringParser.TryParse(v, out envVars, mustHaveValue: false);
                x.SyncthingCommandLineFlags = envVars.Select(item => KeyValueStringParser.FormatItem(item.Key, item.Value)).ToList();
            }, new SyncthingCommandLineFlagsValidator());
            this.SyncthingCommandLineFlags.RequiresSyncthingRestart = true;

            this.SyncthingEnvironmentalVariables = this.CreateBasicSettingItem(
                x => KeyValueStringParser.Format(x.SyncthingEnvironmentalVariables),
                (x, v) =>
            {
                IEnumerable <KeyValuePair <string, string> > envVars;
                KeyValueStringParser.TryParse(v, out envVars);
                x.SyncthingEnvironmentalVariables = new EnvironmentalVariableCollection(envVars);
            }, new SyncthingEnvironmentalVariablesValidator());
            this.SyncthingEnvironmentalVariables.RequiresSyncthingRestart = true;

            this.SyncthingCustomHomePath = this.CreateBasicSettingItem(x => x.SyncthingCustomHomePath);
            this.SyncthingCustomHomePath.RequiresSyncthingRestart = true;

            this.SyncthingDenyUpgrade = this.CreateBasicSettingItem(x => x.SyncthingDenyUpgrade);
            this.SyncthingDenyUpgrade.RequiresSyncthingRestart = true;

            var configuration = this.configurationProvider.Load();

            foreach (var settingItem in this.settings)
            {
                settingItem.LoadValue(configuration);
            }

            foreach (var folderSetting in this.FolderSettings)
            {
                folderSetting.Bind(s => s.IsWatched, (o, e) => this.UpdateAreAllFoldersWatched());
                folderSetting.Bind(s => s.IsNotified, (o, e) => this.UpdateAreAllFoldersNotified());
            }

            this.PriorityLevels = new BindableCollection <LabelledValue <SyncthingPriorityLevel> >()
            {
                LabelledValue.Create(Resources.SettingsView_Syncthing_ProcessPriority_AboveNormal, SyncTrayzor.Services.Config.SyncthingPriorityLevel.AboveNormal),
                LabelledValue.Create(Resources.SettingsView_Syncthing_ProcessPriority_Normal, SyncTrayzor.Services.Config.SyncthingPriorityLevel.Normal),
                LabelledValue.Create(Resources.SettingsView_Syncthing_ProcessPriority_BelowNormal, SyncTrayzor.Services.Config.SyncthingPriorityLevel.BelowNormal),
                LabelledValue.Create(Resources.SettingsView_Syncthing_ProcessPriority_Idle, SyncTrayzor.Services.Config.SyncthingPriorityLevel.Idle),
            };

            this.Bind(s => s.AreAllFoldersNotified, (o, e) =>
            {
                if (this.updatingFolderSettings)
                {
                    return;
                }

                this.updatingFolderSettings = true;

                foreach (var folderSetting in this.FolderSettings)
                {
                    folderSetting.IsNotified = e.NewValue.GetValueOrDefault(false);
                }

                this.updatingFolderSettings = false;
            });

            this.Bind(s => s.AreAllFoldersWatched, (o, e) =>
            {
                if (this.updatingFolderSettings)
                {
                    return;
                }

                this.updatingFolderSettings = true;

                foreach (var folderSetting in this.FolderSettings)
                {
                    folderSetting.IsWatched = e.NewValue.GetValueOrDefault(false);
                }

                this.updatingFolderSettings = false;
            });

            this.UpdateAreAllFoldersWatched();
            this.UpdateAreAllFoldersNotified();
        }
Example #19
0
 public ConfigFolderCleaner(IApplicationPathsProvider applicationPathsProvider, IFilesystemProvider filesystemProvider)
 {
     this.applicationPathsProvider = applicationPathsProvider;
     this.filesystemProvider = filesystemProvider;
 }
Example #20
0
        public SettingsViewModel(
            IConfigurationProvider configurationProvider,
            IAutostartProvider autostartProvider,
            IWindowManager windowManager,
            IProcessStartProvider processStartProvider,
            IAssemblyProvider assemblyProvider,
            IApplicationState applicationState,
            IApplicationPathsProvider applicationPathsProvider,
            ISyncthingManager syncthingManager,
            IMeteredNetworkManager meteredNetworkManager)
        {
            this.configurationProvider    = configurationProvider;
            this.autostartProvider        = autostartProvider;
            this.windowManager            = windowManager;
            this.processStartProvider     = processStartProvider;
            this.assemblyProvider         = assemblyProvider;
            this.applicationState         = applicationState;
            this.applicationPathsProvider = applicationPathsProvider;
            this.syncthingManager         = syncthingManager;

            this.MinimizeToTray      = this.CreateBasicSettingItem(x => x.MinimizeToTray);
            this.NotifyOfNewVersions = this.CreateBasicSettingItem(x => x.NotifyOfNewVersions);
            this.CloseToTray         = this.CreateBasicSettingItem(x => x.CloseToTray);
            this.ObfuscateDeviceIDs  = this.CreateBasicSettingItem(x => x.ObfuscateDeviceIDs);
            this.UseComputerCulture  = this.CreateBasicSettingItem(x => x.UseComputerCulture);
            this.UseComputerCulture.RequiresSyncTrayzorRestart = true;
            this.DisableHardwareRendering = this.CreateBasicSettingItem(x => x.DisableHardwareRendering);
            this.DisableHardwareRendering.RequiresSyncTrayzorRestart = true;
            this.EnableConflictFileMonitoring = this.CreateBasicSettingItem(x => x.EnableConflictFileMonitoring);
            this.EnableFailedTransferAlerts   = this.CreateBasicSettingItem(x => x.EnableFailedTransferAlerts);

            this.PauseDevicesOnMeteredNetworks          = this.CreateBasicSettingItem(x => x.PauseDevicesOnMeteredNetworks);
            this.PauseDevicesOnMeteredNetworksSupported = meteredNetworkManager.IsSupportedByWindows;

            this.ShowTrayIconOnlyOnClose = this.CreateBasicSettingItem(x => x.ShowTrayIconOnlyOnClose);
            this.ShowSynchronizedBalloonEvenIfNothingDownloaded = this.CreateBasicSettingItem(x => x.ShowSynchronizedBalloonEvenIfNothingDownloaded);
            this.ShowDeviceConnectivityBalloons     = this.CreateBasicSettingItem(x => x.ShowDeviceConnectivityBalloons);
            this.ShowDeviceOrFolderRejectedBalloons = this.CreateBasicSettingItem(x => x.ShowDeviceOrFolderRejectedBalloons);

            this.IconAnimationModes = new BindableCollection <LabelledValue <IconAnimationMode> >()
            {
                LabelledValue.Create(Resources.SettingsView_TrayIconAnimation_DataTransferring, Services.Config.IconAnimationMode.DataTransferring),
                LabelledValue.Create(Resources.SettingsView_TrayIconAnimation_Syncing, Services.Config.IconAnimationMode.Syncing),
                LabelledValue.Create(Resources.SettingsView_TrayIconAnimation_Disabled, Services.Config.IconAnimationMode.Disabled),
            };
            this.IconAnimationMode = this.CreateBasicSettingItem(x => x.IconAnimationMode);

            this.StartSyncthingAutomatically = this.CreateBasicSettingItem(x => x.StartSyncthingAutomatically);
            this.SyncthingPriorityLevel      = this.CreateBasicSettingItem(x => x.SyncthingPriorityLevel);
            this.SyncthingPriorityLevel.RequiresSyncthingRestart = true;
            this.SyncthingAddress = this.CreateBasicSettingItem(x => x.SyncthingAddress, new SyncthingAddressValidator());
            this.SyncthingAddress.RequiresSyncthingRestart = true;

            this.CanReadAutostart  = this.autostartProvider.CanRead;
            this.CanWriteAutostart = this.autostartProvider.CanWrite;
            if (this.autostartProvider.CanRead)
            {
                var currentSetup = this.autostartProvider.GetCurrentSetup();
                this.StartOnLogon   = currentSetup.AutoStart;
                this.StartMinimized = currentSetup.StartMinimized;
            }

            this.SyncthingCommandLineFlags = this.CreateBasicSettingItem(
                x => String.Join(" ", x.SyncthingCommandLineFlags),
                (x, v) =>
            {
                KeyValueStringParser.TryParse(v, out var envVars, mustHaveValue: false);
                x.SyncthingCommandLineFlags = envVars.Select(item => KeyValueStringParser.FormatItem(item.Key, item.Value)).ToList();
            }, new SyncthingCommandLineFlagsValidator());
Example #21
0
 public UpdateDownloader(IApplicationPathsProvider pathsProvider, IFilesystemProvider filesystemProvider, IInstallerCertificateVerifier installerVerifier)
 {
     this.downloadsDir       = pathsProvider.UpdatesDownloadPath;
     this.filesystemProvider = filesystemProvider;
     this.installerVerifier  = installerVerifier;
 }
Example #22
0
 public ConfigFolderCleaner(IApplicationPathsProvider applicationPathsProvider, IFilesystemProvider filesystemProvider)
 {
     this.applicationPathsProvider = applicationPathsProvider;
     this.filesystemProvider       = filesystemProvider;
 }