private void FillServiceInfo(ServiceInfo info, IWmiInstance instance)
 {
     ProviderBase.FillCollectionInfo((ICollection)info.Service.BaseAddresses, instance, "BaseAddresses");
     instance.SetProperty("CounterInstanceName", PerformanceCounters.PerformanceCountersEnabled ? ServicePerformanceCountersBase.CreateFriendlyInstanceName(info.Service) : string.Empty);
     instance.SetProperty("ConfigurationName", info.ConfigurationName);
     instance.SetProperty("DistinguishedName", info.DistinguishedName);
     instance.SetProperty("Name", info.Name);
     instance.SetProperty("Namespace", info.Namespace);
     instance.SetProperty("Metadata", info.Metadata);
     instance.SetProperty("Opened", ManagementExtension.GetTimeOpened(info.Service));
     this.FillBehaviorsInfo(info, instance);
     FillExtensionsInfo(info, instance);
     this.FillChannelsInfo(info, instance);
 }
        private static void FillAddressInfo(System.ServiceModel.Administration.EndpointInfo endpoint, IWmiInstance instance)
        {
            string[] info = new string[endpoint.Headers.Count];
            int      num  = 0;

            foreach (AddressHeader header in endpoint.Headers)
            {
                PlainXmlWriter writer = new PlainXmlWriter();
                header.WriteAddressHeader(writer);
                info[num++] = writer.ToString();
            }
            ProviderBase.FillCollectionInfo(info, instance, "AddressHeaders");
            instance.SetProperty("Address", (endpoint.Address == null) ? string.Empty : endpoint.Address.ToString());
            instance.SetProperty("ListenUri", (endpoint.ListenUri == null) ? string.Empty : endpoint.ListenUri.ToString());
            instance.SetProperty("AddressIdentity", (endpoint.Identity == null) ? string.Empty : endpoint.Identity.ToString());
        }
示例#3
0
        void FillServiceInfo(ServiceInfo info, IWmiInstance instance)
        {
            Fx.Assert(null != instance, "");
            Fx.Assert(null != info, "");
            ProviderBase.FillCollectionInfo(info.Service.BaseAddresses, instance, AdministrationStrings.BaseAddresses);
            instance.SetProperty(AdministrationStrings.CounterInstanceName, PerformanceCounters.PerformanceCountersEnabled ? ServicePerformanceCounters.GetFriendlyInstanceName(info.Service) : String.Empty);
            instance.SetProperty(AdministrationStrings.ConfigurationName, info.ConfigurationName);
            instance.SetProperty(AdministrationStrings.DistinguishedName, info.DistinguishedName);
            instance.SetProperty(AdministrationStrings.Name, info.Name);
            instance.SetProperty(AdministrationStrings.Namespace, info.Namespace);
            instance.SetProperty(AdministrationStrings.Metadata, info.Metadata);
            instance.SetProperty(AdministrationStrings.Opened, ManagementExtension.GetTimeOpened(info.Service));


            FillBehaviorsInfo(info, instance);
            FillExtensionsInfo(info, instance);
            FillChannelsInfo(info, instance);
        }
        static void FillAddressInfo(EndpointInfo endpoint, IWmiInstance instance)
        {
            Fx.Assert(null != endpoint, "");
            Fx.Assert(null != instance, "");
            string[] headers = new string[endpoint.Headers.Count];
            int      i       = 0;

            foreach (AddressHeader header in endpoint.Headers)
            {
                PlainXmlWriter xmlWriter = new PlainXmlWriter();
                header.WriteAddressHeader(xmlWriter);
                headers[i++] = xmlWriter.ToString();
            }
            ProviderBase.FillCollectionInfo(headers, instance, AdministrationStrings.AddressHeaders);
            instance.SetProperty(AdministrationStrings.Address, endpoint.Address == null ? String.Empty : endpoint.Address.ToString());
            instance.SetProperty(AdministrationStrings.ListenUri, endpoint.ListenUri == null ? String.Empty : endpoint.ListenUri.ToString());
            instance.SetProperty(AdministrationStrings.Identity, endpoint.Identity == null ? String.Empty : endpoint.Identity.ToString());
        }
示例#5
0
 static void FillExtensionsInfo(ServiceInfo info, IWmiInstance instance)
 {
     Fx.Assert(null != instance, "");
     Fx.Assert(null != info, "");
     ProviderBase.FillCollectionInfo(info.Service.Extensions, instance, AdministrationStrings.Extensions);
 }
 private static void FillExtensionsInfo(ServiceInfo info, IWmiInstance instance)
 {
     ProviderBase.FillCollectionInfo(info.Service.Extensions, instance, "Extensions");
 }