public void ApplyConfiguration(InstanceConfiguration configuration) { ManagementObject.SetPropertyValue("LogMessagesAtServiceLevel", configuration.LogMessageAtServiceLevel); ManagementObject.SetPropertyValue("TraceLevel", configuration.ServiceModelTraceLevel); ManagementObject.Put(); Configuration = InstanceConfiguration.ReadFromWmi(ManagementObject); }
public static InstanceConfiguration ReadFromWmi(ManagementObject mo) { var newConfiguration = new InstanceConfiguration { ServiceModelTraceLevel = (string)mo["TraceLevel"], LogMessageAtServiceLevel = (bool)mo["LogMessagesAtServiceLevel"] }; return(newConfiguration); }
private void applyButton_Click(object sender, EventArgs e) { WcfServiceAppDomain[] appDomains = SelectedAppDomains.ToArray(); if (appDomains.Length == 0) { return; } string serviceModelTraceLevelValue = (string)serviceModelTraceLevel.SelectedItem; if (serviceModelTraceLevelValue == null) { return; } if (logMessagesAtServiceLevelBox.CheckState == CheckState.Indeterminate) { return; } if (activityTracingCheckbox.CheckState == CheckState.Indeterminate) { return; } if (activityTracingCheckbox.Checked) { serviceModelTraceLevelValue += ", ActivityTracing"; } var newConfiguration = new InstanceConfiguration { LogMessageAtServiceLevel = logMessagesAtServiceLevelBox.Checked, ServiceModelTraceLevel = serviceModelTraceLevelValue }; foreach (var appDomain in appDomains) { appDomain.ApplyConfiguration(newConfiguration); } RefreshGrid(); }
public WcfServiceAppDomain(ManagementObject mo) { ManagementObject = mo; Name = (string)mo["Name"]; Configuration = InstanceConfiguration.ReadFromWmi(mo); }