/// <summary> /// Initializes a new instance of the <see cref="IronySparkleUpdater" /> class. /// </summary> /// <param name="isInstallerVersion">if set to <c>true</c> [is installer version].</param> /// <param name="updaterService">The updater service.</param> /// <param name="appAction">The application action.</param> public IronySparkleUpdater(bool isInstallerVersion, IUpdaterService updaterService, IAppAction appAction) : base(Constants.AppCastAddress, new Ed25519Checker(NetSparkleUpdater.Enums.SecurityMode.OnlyVerifySoftwareDownloads, Constants.PublicUpdateKey)) { IsInstallerVersion = isInstallerVersion; this.updaterService = updaterService; this.appAction = appAction; }
public Win32Service(IUpdaterService updaterService) { InitializeComponent(); this._updaterService = updaterService; // fecha inicio del proceso this._processStartTime = DateTime.Now.AddMinutes(DEFAULT_FIRST_TIME); // obtener el intervalo del archivo de configuracion (si no existe, sera el intervalo por defecto 'DEFAULT_INTERVAL') // NOTA: para facilitar la insercion, el valor del archivo de configuracion se consideran minutos, de modo que se multiplica por 1000 * 60 // para crear los milisegundos del timer. string interval = System.Configuration.ConfigurationManager.AppSettings["PROCESS_INTERVAL"]; this._processInterval = 1000 * 60 * ((string.IsNullOrWhiteSpace(interval)) ? DEFAULT_INTERVAL : Convert.ToInt32(interval)); // log _log.Info($"Servicio configurado para ejecutarse con los siguientes parámetros" + $"Primera ejecución: {this._processStartTime}" + $"Siguientes ejecuciones en intervalos de: {this._processInterval / 60 / 1000} minutos." ); // Inicializar el timer this._timer = new System.Timers.Timer(); this._timer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Tick); }
public SyncBlockViewModel(IUpdaterService updaterService) { _updaterService = updaterService; _unsubscriber = _updaterService.Subscribe(this); SyncBlockInfos = new ObservableCollection <SyncBlockInfo>(); CombinedBlockInfos = new ObservableCollection <CombinedBlockInfo>(); RegistryFullBlockInfos = new ObservableCollection <RegistryFullBlockInfo>(); _timer = new Timer(new TimerCallback(o => { if (!_initialized) { lock (_updaterService) { if (!_initialized) { _updaterService.Initialize(); _initialized = true; } } } _updaterService.Update(); }), null, TimeSpan.Zero, TimeSpan.FromSeconds(5)); }
public VersionController( IMapper mapper, IUpdaterService updaterService) { this.mapper = mapper; this.updaterService = updaterService; }
public Service(ServiceBase service) { Id = service.Id; ServiceObject = service; UpdaterObject = service as IUpdaterService; _sceneControllers = new HashSet <SceneControllerBase>(); }
public MainService() { _cancellationTokenSource = new CancellationTokenSource(); _cancellationToken = _cancellationTokenSource.Token; ResetEvents = new List <ManualResetEvent>(); _updaterService = CcContainer.Resolve <IUpdaterService>(); InitializeComponent(); }
public AutoUpdateService(IUpdaterService updater, IUpdaterConfig userSettings) { _updater = updater; _userSettings = userSettings; _timer = new Timer(100) { AutoReset = false }; _timer.Elapsed += TimerOnElapsed; }
/// <summary> /// Initializes a new instance of the <see cref="OptionsControlViewModel" /> class. /// </summary> /// <param name="messageBus">The message bus.</param> /// <param name="logger">The logger.</param> /// <param name="notificationAction">The notification action.</param> /// <param name="localizationManager">The localization manager.</param> /// <param name="updater">The updater.</param> /// <param name="updaterService">The updater service.</param> /// <param name="gameService">The game service.</param> /// <param name="fileDialogAction">The file dialog action.</param> public OptionsControlViewModel(Shared.MessageBus.IMessageBus messageBus, ILogger logger, INotificationAction notificationAction, ILocalizationManager localizationManager, IUpdater updater, IUpdaterService updaterService, IGameService gameService, IFileDialogAction fileDialogAction) { this.gameService = gameService; this.fileDialogAction = fileDialogAction; this.updaterService = updaterService; this.updater = updater; this.localizationManager = localizationManager; this.notificationAction = notificationAction; this.logger = logger; this.messageBus = messageBus; }
/// <summary> /// Initializes a new instance of the <see cref="OptionsControlViewModel" /> class. /// </summary> /// <param name="externalEditorService">The external editor service.</param> /// <param name="idGenerator">The identifier generator.</param> /// <param name="messageBus">The message bus.</param> /// <param name="logger">The logger.</param> /// <param name="notificationAction">The notification action.</param> /// <param name="localizationManager">The localization manager.</param> /// <param name="updater">The updater.</param> /// <param name="updaterService">The updater service.</param> /// <param name="gameService">The game service.</param> /// <param name="fileDialogAction">The file dialog action.</param> public OptionsControlViewModel(IExternalEditorService externalEditorService, IIDGenerator idGenerator, Shared.MessageBus.IMessageBus messageBus, ILogger logger, INotificationAction notificationAction, ILocalizationManager localizationManager, IUpdater updater, IUpdaterService updaterService, IGameService gameService, IFileDialogAction fileDialogAction) { this.gameService = gameService; this.fileDialogAction = fileDialogAction; this.updaterService = updaterService; this.updater = updater; this.localizationManager = localizationManager; this.notificationAction = notificationAction; this.logger = logger; this.messageBus = messageBus; this.idGenerator = idGenerator; this.externalEditorService = externalEditorService; LeftMargin = new Thickness(20, 0, 0, 0); LeftChildMargin = new Thickness(20, 10, 0, 0); }
/// <summary> /// Initializes a new instance of the <see cref="OptionsControlViewModel" /> class. /// </summary> /// <param name="modService">The mod service.</param> /// <param name="positionSettingsService">The position settings service.</param> /// <param name="externalEditorService">The external editor service.</param> /// <param name="idGenerator">The identifier generator.</param> /// <param name="logger">The logger.</param> /// <param name="notificationAction">The notification action.</param> /// <param name="localizationManager">The localization manager.</param> /// <param name="updater">The updater.</param> /// <param name="updaterService">The updater service.</param> /// <param name="gameService">The game service.</param> /// <param name="fileDialogAction">The file dialog action.</param> public OptionsControlViewModel(IModService modService, INotificationPositionSettingsService positionSettingsService, IExternalEditorService externalEditorService, IIDGenerator idGenerator, ILogger logger, INotificationAction notificationAction, ILocalizationManager localizationManager, IUpdater updater, IUpdaterService updaterService, IGameService gameService, IFileDialogAction fileDialogAction) { this.positionSettingsService = positionSettingsService; this.gameService = gameService; this.fileDialogAction = fileDialogAction; this.updaterService = updaterService; this.updater = updater; this.localizationManager = localizationManager; this.notificationAction = notificationAction; this.logger = logger; this.idGenerator = idGenerator; this.externalEditorService = externalEditorService; this.modService = modService; LeftMargin = new Thickness(20, 0, 0, 0); LeftChildMargin = new Thickness(20, 10, 0, 0); }
public MainForm(ILogger <MainForm> logger, IUpdaterService updaterService, IFileService fileService, IDownloadService downloadService) { logger.LogDebug("Constructing: {0}", nameof(MainForm)); try { _logger = logger; _fileService = fileService; _updaterService = updaterService; _downloadService = downloadService; _cancellationTokenSource = new CancellationTokenSource(); InitializeComponent(); } catch (Exception ex) { _logger.LogCritical(ex, "Main form failed to create."); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Close(); } }
/// <summary> /// Initializes a new instance of the <see cref="Updater" /> class. /// </summary> /// <param name="updateProgressHandler">The update progress handler.</param> /// <param name="updaterService">The updater service.</param> /// <param name="appAction">The application action.</param> /// <param name="shutDownState">State of the shut down.</param> public Updater(UpdateUnpackProgressHandler updateProgressHandler, IUpdaterService updaterService, IAppAction appAction, IShutDownState shutDownState) { this.shutDownState = shutDownState; isInstallerVersion = IsInstallerVersion(); this.updaterService = updaterService; progress = new Subject <int>(); error = new Subject <Exception>(); updater = new IronySparkleUpdater(isInstallerVersion, updaterService, appAction) { SecurityProtocolType = System.Net.SecurityProtocolType.Tls12, AppCastHandler = new IronyAppCast(isInstallerVersion, updaterService), Configuration = new UpdaterConfiguration(new EntryAssemblyAccessor()), TmpDownloadFilePath = StaticResources.GetUpdaterPath().FirstOrDefault() }; updater.DownloadStarted += (sender, path) => { progress.OnNext(0); }; updater.DownloadHadError += (sender, path, exception) => { if (exception.Message != lastException?.Message) { error.OnNext(exception); lastException = exception; } }; updater.DownloadMadeProgress += (sender, item, progress) => { this.progress.OnNext(progress.ProgressPercentage); }; updater.DownloadFinished += (sender, path) => { updatePath = path; progress.OnNext(100); }; updateProgressHandler.Subscribe(s => { progress.OnNext(s.Progress); }); }
public ClassUpdaterViewModelService(IMapper _mapper, IUpdaterService <Template> _updaterService, IFinderService <Template> _finderViewModelService) : base(_mapper, _updaterService, _finderViewModelService) { }
/// <summary> /// Initializes a new instance of the <see cref="IronyAppCast" /> class. /// </summary> /// <param name="isInstallerVersion">if set to <c>true</c> [is installer version].</param> /// <param name="updaterService">The updater service.</param> public IronyAppCast(bool isInstallerVersion, IUpdaterService updaterService) : base() { appCast = new XMLAppCast(); IsInstallerVersion = isInstallerVersion; this.updaterService = updaterService; }
/// <summary> /// Default constructor for the update page /// </summary> /// <param name="updaterService">The updater Service providing the behavior</param> public UpdateController(IUpdaterService updaterService) { this.updaterService = updaterService; }
public MainViewModel(IUpdaterService updaterService) { SyncBlockViewModel = new SyncBlockViewModel(updaterService); }
public MainWindow(IUpdaterService updaterService) { InitializeComponent(); DataContext = new MainViewModel(updaterService); }
/// <summary> /// Constructor de la clase que inicializa y asigna datos por defecto /// </summary> /// <param name="_mapper"> Dependencia correspondiente a la biblioteca que se encarga de mapear tipos diferentes de objetos. </param> /// <param name="_updaterService"> Dependencia correspondiente al servicio de actualización de una entidad genérica. </param> /// <param name="_finderService"> Dependencia correspondiente al servicio de busqueda de una entidad genérica. </param> protected UpdaterViewModelService(IMapper _mapper, IUpdaterService <TEntity> _updaterService, IFinderService <TEntity> _finderService) { this.mapper = _mapper ?? throw new ArgumentNullException(nameof(_mapper)); this.updateService = _updaterService ?? throw new ArgumentNullException(nameof(_updaterService)); this.finderService = _finderService ?? throw new ArgumentNullException(nameof(_finderService)); }
public UpdatesController(IConfiguration configuration, IUpdaterService updater) { _updater = updater; _configuration = configuration; _securityKey = _configuration["Authentication:Key"]; }