/// <summary> /// Initializes the update manager. /// </summary> public WindowsUpdateManager(OperationResultFormatter operationResultFormatter, NodeAgentSfUtility nodeAgentSfUtility, SettingsManager settingsManager, CancellationToken cancellationToken) { this._uSession = new UpdateSession(); this._operationResultFormatter = operationResultFormatter; this._helper = new Helper(); this._settingsManager = settingsManager; this._task = null; this._cancellationToken = cancellationToken; this._nodeAgentSfUtility = nodeAgentSfUtility; this.ResetManager(); }
/// <summary> /// Initializes Windows Service. /// </summary> public POAService(string nodeName, string applicationName) { _eventSource.InfoMessage("POSNodeSvc initalizing for Node {0}, Application {1}", nodeName, applicationName); this.ServiceName = "POSNodeSvc"; Uri applicationUri = new Uri(applicationName); this._tokenSource = new CancellationTokenSource(); SettingsManager settingsManager = new SettingsManager(); var nodeAgentSfUtility = new NodeAgentSfUtility(nodeName, applicationUri, settingsManager, this._tokenSource.Token); OperationResultFormatter operationResultFormatter = new OperationResultFormatter(nodeName, settingsManager.GetSettings()); WindowsUpdateManager windowsUpdateManager = new WindowsUpdateManager(operationResultFormatter, nodeAgentSfUtility, settingsManager, this._tokenSource.Token); // timer manager will take care of stopping and disposing windows update manager also. this._timerManager = new TimerManager(nodeAgentSfUtility, settingsManager, windowsUpdateManager, this._tokenSource.Token); }