예제 #1
0
 public void ApplyConfiguration(InstanceConfiguration configuration)
 {
     ManagementObject.SetPropertyValue("LogMessagesAtServiceLevel", configuration.LogMessageAtServiceLevel);
     ManagementObject.SetPropertyValue("TraceLevel", configuration.ServiceModelTraceLevel);
     ManagementObject.Put();
     Configuration = InstanceConfiguration.ReadFromWmi(ManagementObject);
 }
예제 #2
0
        public static InstanceConfiguration ReadFromWmi(ManagementObject mo)
        {
            var newConfiguration = new InstanceConfiguration
            {
                ServiceModelTraceLevel   = (string)mo["TraceLevel"],
                LogMessageAtServiceLevel = (bool)mo["LogMessagesAtServiceLevel"]
            };

            return(newConfiguration);
        }
예제 #3
0
        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();
        }
예제 #4
0
 public WcfServiceAppDomain(ManagementObject mo)
 {
     ManagementObject = mo;
     Name             = (string)mo["Name"];
     Configuration    = InstanceConfiguration.ReadFromWmi(mo);
 }