Пример #1
0
        private ServiceSettings GetDefaultServiceSettings()
        {
            ServiceSettings serviceSettings = new ServiceSettings();

            serviceSettings.WUQuery = DefaultWUQuery;
            serviceSettings.WUOperationRetryCount          = DefaultWUOperationRetryCount;
            serviceSettings.WUDelayBetweenRetriesInMinutes = DefaultWUDelayBetweenRetriesInMinutes;
            serviceSettings.WUOperationTimeOutInMinutes    = DefaultWUOperationTimeOutInMinutes;
            serviceSettings.WURescheduleTimeInMinutes      = DefaultWURescheduleTimeInMinutes;
            serviceSettings.WURescheduleCount           = DefaultWURescheduleCount;
            serviceSettings.WUFrequency                 = DefaultWUFrequency;
            serviceSettings.DisableWindowsUpdates       = DefaultDisableAutoUpdateSettingInOS;
            serviceSettings.OperationTimeOutInMinutes   = DefaultOperationTimeOutInMinutes;
            serviceSettings.InstallWindowsOSOnlyUpdates = DefaultInstallWindowsOSOnlyUpdates;
            serviceSettings.WUQueryCategoryIds          = DefaultWUQueryCategoryIds;
            serviceSettings.AcceptWindowsUpdateEula     = DefaultAcceptWindowsUpdateEula;

            serviceSettings.ParseSettings();

            return(serviceSettings);
        }
Пример #2
0
        private ServiceSettings GetServiceSettings(XmlNode node)
        {
            ServiceSettings serviceSettings = new ServiceSettings();

            serviceSettings.WUQuery = this.GetParameter <string>(node, WUQueryName, DefaultWUQuery);
            serviceSettings.WUOperationRetryCount          = this.GetParameter <long>(node, WUOperationRetryCountName, DefaultWUOperationRetryCount);
            serviceSettings.WUDelayBetweenRetriesInMinutes = this.GetParameter <long>(node, WUDelayBetweenRetriesInMinutesName, DefaultWUDelayBetweenRetriesInMinutes);
            serviceSettings.WUOperationTimeOutInMinutes    = this.GetParameter <long>(node, WUOperationTimeOutInMinutesName, DefaultWUOperationTimeOutInMinutes);
            serviceSettings.WURescheduleTimeInMinutes      = this.GetParameter <long>(node, WURescheduleTimeInMinutesName, DefaultWURescheduleTimeInMinutes);
            serviceSettings.WURescheduleCount           = this.GetParameter <long>(node, WURescheduleCountName, DefaultWURescheduleCount);
            serviceSettings.WUFrequency                 = this.GetParameter <string>(node, WUFrequencyName, DefaultWUFrequency);
            serviceSettings.DisableWindowsUpdates       = this.GetParameter <bool>(node, DisableAutoUpdateSettingInOSName, DefaultDisableAutoUpdateSettingInOS);
            serviceSettings.OperationTimeOutInMinutes   = this.GetParameter <long>(node, OperationTimeOutInMinutesName, DefaultOperationTimeOutInMinutes);
            serviceSettings.InstallWindowsOSOnlyUpdates = this.GetParameter <bool>(node, InstallWindowsOSOnlyUpdateName, DefaultInstallWindowsOSOnlyUpdates);
            serviceSettings.WUQueryCategoryIds          = this.GetParameter <string>(node, WUQueryCategoryIdsName, DefaultWUQueryCategoryIds);
            serviceSettings.AcceptWindowsUpdateEula     = this.GetParameter <bool>(node, AcceptWindowsUpdateEulaName, DefaultAcceptWindowsUpdateEula);

            serviceSettings.ParseSettings();

            return(serviceSettings);
        }