/// <summary> /// Overrides the <paramref name="configurationObject"/>'s properties with the Group Policy values from the /// registry. /// </summary> /// <param name="configurationObject">The configuration object for instances that must be managed.</param> /// <param name="policyKey">The <see cref="IRegistryKey"/> which holds the Group Policy overrides for the /// configuration element.</param> /// <remarks>Subclasses implementing this method must retrieve all the override values from the registry /// before making modifications to the <paramref name="configurationObject"/> so any error retrieving /// the override values will cancel policy processing.</remarks> protected override void OverrideWithGroupPolicies(MsmqTraceListenerData configurationObject, IRegistryKey policyKey) { String formatterOverride = GetFormatterPolicyOverride(policyKey); MessagePriority?messagePriorityOverride = policyKey.GetEnumValue <MessagePriority>(MessagePriorityPropertyName); String queuePathOverride = policyKey.GetStringValue(QueuePathPropertyName); bool? recoverableOverride = policyKey.GetBoolValue(RecoverablePropertyName); TimeSpan timeToBeReceivedOverride = GetTimeSpanOverride(policyKey, TimeToBeReceivedPropertyName); TimeSpan timeToReachQueueOverride = GetTimeSpanOverride(policyKey, TimeToReachQueuePropertyName); TraceOptions? traceOutputOptionsOverride = GetFlagsEnumOverride <TraceOptions>(policyKey, TraceOutputOptionsPropertyName); SourceLevels?filterOverride = policyKey.GetEnumValue <SourceLevels>(FilterPropertyName); MessageQueueTransactionType?transactionTypeOverride = policyKey.GetEnumValue <MessageQueueTransactionType>(TransactionTypePropertyName); bool?usedAuthenticationOverride = policyKey.GetBoolValue(UseAuthenticationPropertyName); bool?useDeadLetterOverride = policyKey.GetBoolValue(UseDeadLetterQueuePropertyName); bool?useEncryptionOverride = policyKey.GetBoolValue(UseEncryptionPropertyName); configurationObject.Formatter = formatterOverride; configurationObject.MessagePriority = messagePriorityOverride.Value; configurationObject.QueuePath = queuePathOverride; configurationObject.Recoverable = recoverableOverride.Value; configurationObject.TimeToReachQueue = timeToReachQueueOverride; configurationObject.TimeToBeReceived = timeToBeReceivedOverride; configurationObject.TraceOutputOptions = traceOutputOptionsOverride.Value; configurationObject.Filter = filterOverride.Value; configurationObject.TransactionType = transactionTypeOverride.Value; configurationObject.UseAuthentication = usedAuthenticationOverride.Value; configurationObject.UseDeadLetterQueue = useDeadLetterOverride.Value; configurationObject.UseEncryption = useEncryptionOverride.Value; }
/// <summary> /// Overrides the <paramref name="configurationObject"/>'s properties with the Group Policy values from the /// registry. /// </summary> /// <param name="configurationObject">The configuration object for instances that must be managed.</param> /// <param name="policyKey">The <see cref="IRegistryKey"/> which holds the Group Policy overrides for the /// configuration element.</param> /// <remarks>Subclasses implementing this method must retrieve all the override values from the registry /// before making modifications to the <paramref name="configurationObject"/> so any error retrieving /// the override values will cancel policy processing.</remarks> protected override void OverrideWithGroupPolicies(RollingFlatFileTraceListenerData configurationObject, IRegistryKey policyKey) { String fileNameOverride = policyKey.GetStringValue(FileNamePropertyName); String formatterOverride = GetFormatterPolicyOverride(policyKey); RollFileExistsBehavior?rollFileExistsBehaviorOverride = policyKey.GetEnumValue <RollFileExistsBehavior>(RollFileExistsBehaviorPropertyName); RollInterval? rollIntervalOverride = policyKey.GetEnumValue <RollInterval>(RollIntervalPropertyName); int? rollSizeKBOverride = policyKey.GetIntValue(RollSizeKBPropertyName); string timeStampPatternOverride = policyKey.GetStringValue(TimeStampPatternPropertyName); TraceOptions?traceOutputOptionsOverride = policyKey.GetEnumValue <TraceOptions>(TraceOutputOptionsPropertyName); SourceLevels?filterOverride = policyKey.GetEnumValue <SourceLevels>(FilterPropertyName); string headerOverride = policyKey.GetStringValue(HeaderPropertyName); string footerOverride = policyKey.GetStringValue(FooterPropertyName); configurationObject.FileName = fileNameOverride; configurationObject.Header = headerOverride; configurationObject.Footer = footerOverride; configurationObject.Formatter = formatterOverride; configurationObject.RollFileExistsBehavior = rollFileExistsBehaviorOverride.Value; configurationObject.RollInterval = rollIntervalOverride.Value; configurationObject.RollSizeKB = rollSizeKBOverride.Value; configurationObject.TimeStampPattern = timeStampPatternOverride; configurationObject.TraceOutputOptions = traceOutputOptionsOverride.Value; configurationObject.Filter = filterOverride.Value; }
protected override void OverrideWithGroupPolicies(XmlTraceListenerData configurationObject, IRegistryKey policyKey) { String fileNameOverride = policyKey.GetStringValue(FileNamePropertyName); TraceOptions?traceOutputOptionsOverride = policyKey.GetEnumValue <TraceOptions>(TraceOutputOptionsPropertyName); configurationObject.FileName = fileNameOverride; configurationObject.TraceOutputOptions = traceOutputOptionsOverride.Value; }
protected override void OverrideWithGroupPolicies(WmiTraceListenerData configurationObject, IRegistryKey policyKey) { TraceOptions?traceOutputOptionsOverride = policyKey.GetEnumValue <TraceOptions>(TraceOutputOptionsPropertyName); SourceLevels?filterOverride = policyKey.GetEnumValue <SourceLevels>(FilterPropertyName); configurationObject.TraceOutputOptions = traceOutputOptionsOverride.Value; configurationObject.Filter = filterOverride.Value; }
protected override void OverrideWithGroupPolicies(T configurationObject, IRegistryKey policyKey) { String initDataOverride = policyKey.GetStringValue(InitDataPropertyName); TraceOptions?traceOutputOptionsOverride = policyKey.GetEnumValue <TraceOptions>(TraceOutputOptionsPropertyName); base.OverrideWithGroupPolicies(configurationObject, policyKey); configurationObject.InitData = initDataOverride; configurationObject.TraceOutputOptions = traceOutputOptionsOverride.Value; }
/// <summary> /// Overrides the <paramref name="configurationObject"/>'s properties with the Group Policy values from the /// registry. /// </summary> /// <param name="configurationObject">The configuration object for instances that must be managed.</param> /// <param name="policyKey">The <see cref="IRegistryKey"/> which holds the Group Policy overrides for the /// configuration element.</param> /// <remarks>Subclasses that manage custom provider's configuration objects with additional properties may /// override this method to override these properties.</remarks> protected override void OverrideWithGroupPolicies(T configurationObject, IRegistryKey policyKey) { String initDataOverride = policyKey.GetStringValue(InitDataPropertyName); TraceOptions?traceOutputOptionsOverride = GetFlagsEnumOverride <TraceOptions>(policyKey, TraceOutputOptionsPropertyName); SourceLevels?filterOverride = policyKey.GetEnumValue <SourceLevels>(FilterPropertyName); base.OverrideWithGroupPolicies(configurationObject, policyKey); configurationObject.InitData = initDataOverride; configurationObject.TraceOutputOptions = traceOutputOptionsOverride.Value; configurationObject.Filter = filterOverride.Value; }
protected override void OverrideWithGroupPolicies(FormattedDatabaseTraceListenerData configurationObject, IRegistryKey policyKey) { String addCategoryStoredProcNameOverride = policyKey.GetStringValue(AddCategoryStoredProcNamePropertyName); String databaseInstanceNameOverride = policyKey.GetStringValue(DatabaseInstanceNamePropertyName); String formatterOverride = GetFormatterPolicyOverride(policyKey); TraceOptions?traceOutputOptionsOverride = policyKey.GetEnumValue <TraceOptions>(TraceOutputOptionsPropertyName); String writeLogStoredProcNameOverride = policyKey.GetStringValue(WriteLogStoredProcNamePropertyName); configurationObject.AddCategoryStoredProcName = addCategoryStoredProcNameOverride; configurationObject.DatabaseInstanceName = databaseInstanceNameOverride; configurationObject.Formatter = formatterOverride; configurationObject.TraceOutputOptions = traceOutputOptionsOverride.Value; configurationObject.WriteLogStoredProcName = writeLogStoredProcNameOverride; }
protected override void OverrideWithGroupPolicies(FlatFileTraceListenerData configurationObject, IRegistryKey policyKey) { String fileNameOverride = policyKey.GetStringValue(FileNamePropertyName); String footerOverride = policyKey.GetStringValue(FooterPropertyName); String formatterOverride = GetFormatterPolicyOverride(policyKey); String headerOverride = policyKey.GetStringValue(HeaderPropertyName); TraceOptions?traceOutputOptionsOverride = policyKey.GetEnumValue <TraceOptions>(TraceOutputOptionsPropertyName); configurationObject.FileName = fileNameOverride; configurationObject.Footer = footerOverride; configurationObject.Formatter = formatterOverride; configurationObject.Header = headerOverride; configurationObject.TraceOutputOptions = traceOutputOptionsOverride.Value; }
protected override void OverrideWithGroupPolicies(FormattedEventLogTraceListenerData configurationObject, IRegistryKey policyKey) { String formatterOverride = GetFormatterPolicyOverride(policyKey); String logOverride = policyKey.GetStringValue(LogPropertyName); String machineNameOverride = policyKey.GetStringValue(MachineNamePropertyName); String sourceOverride = policyKey.GetStringValue(SourcePropertyName); TraceOptions?traceOutputOptionsOverride = policyKey.GetEnumValue <TraceOptions>(TraceOutputOptionsPropertyName); configurationObject.Formatter = formatterOverride; configurationObject.Log = logOverride; configurationObject.MachineName = machineNameOverride; configurationObject.Source = sourceOverride; configurationObject.TraceOutputOptions = traceOutputOptionsOverride.Value; }
protected override void OverrideWithGroupPolicies(RollOnceTraceListenerData configObj, IRegistryKey policyKey) { string filenameOverride = policyKey.GetStringValue(FilenamePropertyName); string headerOverride = policyKey.GetStringValue(HeaderPropertyName); string footerOverride = policyKey.GetStringValue(FooterPropertyName); int? maxLogs = policyKey.GetIntValue(MaxLogsPropertyName); string formatterOverride = GetFormatterPolicyOverride(policyKey); TraceOptions?traceOutputOptionsO = policyKey.GetEnumValue <TraceOptions>(TraceOutputOptionsPropertyName); SourceLevels?filterOverride = policyKey.GetEnumValue <SourceLevels>(FilterPropertyName); configObj.FileName = filenameOverride; configObj.Header = headerOverride; configObj.Footer = footerOverride; configObj.Formatter = formatterOverride; configObj.MaxLogs = maxLogs.Value; configObj.TraceOutputOptions = traceOutputOptionsO.Value; configObj.Filter = filterOverride.Value; }
protected override void OverrideWithGroupPolicies(EmailTraceListenerData configurationObject, IRegistryKey policyKey) { String formatterOverride = GetFormatterPolicyOverride(policyKey); String fromAddressOverride = policyKey.GetStringValue(FromAddressPropertyName); int? smtpPortOverride = policyKey.GetIntValue(SmtpPortPropertyName); String smtpServerOverride = policyKey.GetStringValue(SmtpServerPropertyName); String subjectLineEnderOverride = policyKey.GetStringValue(SubjectLineEnderPropertyName); String subjectLineStarterOverride = policyKey.GetStringValue(SubjectLineStarterPropertyName); String toAddressOverride = policyKey.GetStringValue(ToAddressPropertyName); TraceOptions?traceOutputOptionsOverride = policyKey.GetEnumValue <TraceOptions>(TraceOutputOptionsPropertyName); configurationObject.Formatter = formatterOverride; configurationObject.FromAddress = fromAddressOverride; configurationObject.SmtpPort = smtpPortOverride.Value; configurationObject.SmtpServer = smtpServerOverride; configurationObject.SubjectLineEnder = subjectLineEnderOverride; configurationObject.SubjectLineStarter = subjectLineStarterOverride; configurationObject.ToAddress = toAddressOverride; configurationObject.TraceOutputOptions = traceOutputOptionsOverride.Value; }