当前位置: 首页>>代码示例>>C#>>正文


C# Discovery.DiscoveryVersion类代码示例

本文整理汇总了C#中System.ServiceModel.Discovery.DiscoveryVersion的典型用法代码示例。如果您正苦于以下问题:C# DiscoveryVersion类的具体用法?C# DiscoveryVersion怎么用?C# DiscoveryVersion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DiscoveryVersion类属于System.ServiceModel.Discovery命名空间,在下文中一共展示了DiscoveryVersion类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AnnouncementEndpoint

		public AnnouncementEndpoint (DiscoveryVersion discoveryVersion)
			: this (discoveryVersion, null, null)
		{
			if (discoveryVersion == null)
				throw new ArgumentNullException ("discoveryVersion");
			DiscoveryVersion = discoveryVersion;
		}
开发者ID:MichaelWalsh,项目名称:mono,代码行数:7,代码来源:AnnouncementEndpoint.cs

示例2: ReadXml

		internal static ResolveCriteria ReadXml (XmlReader reader, DiscoveryVersion version)
		{
			if (reader == null)
				throw new ArgumentNullException ("reader");

			var ret = new ResolveCriteria ();

			reader.MoveToContent ();
			if (!reader.IsStartElement ("ResolveType", version.Namespace) || reader.IsEmptyElement)
				throw new XmlException ("Non-empty ResolveType element is expected");
			reader.ReadStartElement ("ResolveType", version.Namespace);

			// standard members
			reader.MoveToContent ();
			ret.Address = EndpointAddress.ReadFrom (version.MessageVersion.Addressing, reader);

			// non-standard members
			for (reader.MoveToContent (); !reader.EOF && reader.NodeType != XmlNodeType.EndElement; reader.MoveToContent ()) {
				if (reader.NamespaceURI == SerializationNS) {
					switch (reader.LocalName) {
					case "Duration":
						ret.Duration = (TimeSpan) reader.ReadElementContentAs (typeof (TimeSpan), null);
						break;
					}
				}
				else
					ret.Extensions.Add (XElement.Load (reader));
			}

			reader.ReadEndElement ();

			return ret;
		}
开发者ID:nickchal,项目名称:pash,代码行数:33,代码来源:ResolveCriteria.cs

示例3: DiscoveryVersion

		static DiscoveryVersion ()
		{
			v11 = new DiscoveryVersion ("WSDiscovery11",
				Namespace11,
				"urn:docs-oasis-open-org:ws-dd:ns:discovery:2009:01",
				MessageVersion.Soap12WSAddressing10,
				typeof (Version11.IAnnouncementContract11),
				typeof (AnnouncementClient11),
				typeof (IDiscoveryProxyContract11),
				typeof (DiscoveryProxyClient11),
				typeof (IDiscoveryTargetContract11),
				typeof (DiscoveryTargetClient11));

			april2005 = new DiscoveryVersion ("WSDiscoveryApril2005",
				NamespaceApril2005,
				"urn:schemas-xmlsoap-org:ws:2005:04:discovery",
				MessageVersion.Soap12WSAddressingAugust2004,
				typeof (IAnnouncementContractApril2005),
				typeof (AnnouncementClientApril2005),
				typeof (IDiscoveryProxyContractApril2005),
				typeof (DiscoveryProxyClientApril2005),
				typeof (IDiscoveryTargetContractApril2005),
				typeof (DiscoveryTargetClientApril2005));

			cd1 = new DiscoveryVersion ("WSDiscoveryCD1",
				NamespaceCD1,
				"urn:docs-oasis-open-org:ws-dd:discovery:2008:09",
				MessageVersion.Soap12WSAddressingAugust2004,
				typeof (IAnnouncementContractCD1),
				typeof (AnnouncementClientCD1),
				typeof (IDiscoveryProxyContractCD1),
				typeof (DiscoveryProxyClientCD1),
				typeof (IDiscoveryTargetContractCD1),
				typeof (DiscoveryTargetClientCD1));
		}
开发者ID:nickchal,项目名称:pash,代码行数:35,代码来源:DiscoveryVersion.cs

示例4: DiscoveryEndpoint

		public DiscoveryEndpoint (DiscoveryVersion discoveryVersion, ServiceDiscoveryMode discoveryMode, Binding binding, EndpointAddress endpointAddress)
			: base (GetContract (discoveryVersion, discoveryMode), binding, endpointAddress)
		{
			DiscoveryVersion = discoveryVersion;
			DiscoveryMode = discoveryMode;

			IsSystemEndpoint = true;
		}
开发者ID:nickchal,项目名称:pash,代码行数:8,代码来源:DiscoveryEndpoint.cs

示例5: UdpAnnouncementEndpoint

		// (6), everything falls to here
		public UdpAnnouncementEndpoint (DiscoveryVersion discoveryVersion, Uri multicastAddress)
			: base (discoveryVersion, CreateBinding (), new EndpointAddress (discoveryVersion.AdhocAddress))
		{
			ListenUri = multicastAddress;
			TransportSettings = new UdpTransportSettings ();
			MulticastAddress = multicastAddress;
			MaxAnnouncementDelay = TimeSpan.FromMilliseconds (500);
		}
开发者ID:afaerber,项目名称:mono,代码行数:9,代码来源:UdpAnnouncementEndpoint.cs

示例6: UdpDiscoveryEndpoint

		// (6), everything falls to here.
		public UdpDiscoveryEndpoint (DiscoveryVersion discoveryVersion, Uri multicastAddress)
			: base (discoveryVersion, ServiceDiscoveryMode.Adhoc, CreateBinding (), new EndpointAddress (discoveryVersion.AdhocAddress))
		{
			ListenUri = multicastAddress;
			TransportSettings = new UdpTransportSettings ();
			MulticastAddress = multicastAddress;
			MaxResponseDelay = TimeSpan.FromMilliseconds (500);
		}
开发者ID:afaerber,项目名称:mono,代码行数:9,代码来源:UdpDiscoveryEndpoint.cs

示例7: DiscoveryEndpoint

		public DiscoveryEndpoint (DiscoveryVersion discoveryVersion, ServiceDiscoveryMode discoveryMode, Binding binding, EndpointAddress endpointAddress)
			: base (null, binding, endpointAddress)
		{
			if (discoveryVersion == null)
				throw new ArgumentNullException ("discoveryVersion");
			DiscoveryVersion = discoveryVersion;
			DiscoveryMode = discoveryMode;
		}
开发者ID:MichaelWalsh,项目名称:mono,代码行数:8,代码来源:DiscoveryEndpoint.cs

示例8: GetAnnouncementContract

        static ContractDescription GetAnnouncementContract(DiscoveryVersion discoveryVersion)
        {
            if (discoveryVersion == null)
            {
                throw FxTrace.Exception.ArgumentNull("discoveryVersion");
            }

            return discoveryVersion.Implementation.GetAnnouncementContract();
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:9,代码来源:AnnouncementEndpoint.cs

示例9: GetDiscoveryContract

        static ContractDescription GetDiscoveryContract(DiscoveryVersion discoveryVersion, ServiceDiscoveryMode discoveryMode)
        {
            if (discoveryVersion == null)
            {
                throw FxTrace.Exception.ArgumentNull("discoveryVersion");
            }

            return discoveryVersion.Implementation.GetDiscoveryContract(discoveryMode);
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:9,代码来源:DiscoveryEndpoint.cs

示例10: EnsureProbeMatchSchema

        public static XmlQualifiedName EnsureProbeMatchSchema(DiscoveryVersion discoveryVersion, XmlSchemaSet schemaSet)
        {
            Fx.Assert(schemaSet != null, "The schemaSet must be non null.");
            Fx.Assert(discoveryVersion != null, "The discoveryVersion must be non null.");

            // ensure that EPR is added to the schema.
            if (discoveryVersion == DiscoveryVersion.WSDiscoveryApril2005 || discoveryVersion == DiscoveryVersion.WSDiscoveryCD1)
            {
                EndpointAddressAugust2004.GetSchema(schemaSet);
            }
            else if (discoveryVersion == DiscoveryVersion.WSDiscovery11)
            {
                EndpointAddress10.GetSchema(schemaSet);
            }
            else
            {
                Fx.Assert("The discoveryVersion is not supported.");
            }

            // do not add/find Probe related schema items
            SchemaTypes typesFound = SchemaTypes.ProbeType | SchemaTypes.ResolveType;
            SchemaElements elementsFound = SchemaElements.None;         

            XmlSchema discoverySchema = null;
            ICollection discoverySchemas = schemaSet.Schemas(discoveryVersion.Namespace);
            if ((discoverySchemas == null) || (discoverySchemas.Count == 0))
            {
                discoverySchema = CreateSchema(discoveryVersion);
                AddImport(discoverySchema, discoveryVersion.Implementation.WsaNamespace);
                schemaSet.Add(discoverySchema);
            }
            else
            {                
                foreach (XmlSchema schema in discoverySchemas)
                {
                    discoverySchema = schema;
                    if (schema.SchemaTypes.Contains(discoveryVersion.Implementation.QualifiedNames.ProbeMatchType))
                    {
                        typesFound |= SchemaTypes.ProbeMatchType;
                        break;
                    }

                    LocateSchemaTypes(discoveryVersion, schema, ref typesFound);
                    LocateSchemaElements(discoveryVersion, schema, ref elementsFound);
                }
            }

            if ((typesFound & SchemaTypes.ProbeMatchType) != SchemaTypes.ProbeMatchType)
            {
                AddSchemaTypes(discoveryVersion, typesFound, discoverySchema);
                AddElements(discoveryVersion, elementsFound, discoverySchema);
                schemaSet.Reprocess(discoverySchema);
            }

            return discoveryVersion.Implementation.QualifiedNames.ProbeMatchType;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:56,代码来源:SchemaUtility.cs

示例11: AnnouncementEndpoint

        public AnnouncementEndpoint(DiscoveryVersion discoveryVersion, Binding binding, EndpointAddress address)
            : base(GetAnnouncementContract(discoveryVersion))
        {
            // Send replies async to maintain performance
            this.EndpointBehaviors.Add(new DispatcherSynchronizationBehavior { AsynchronousSendEnabled = true });

            this.discoveryVersion = discoveryVersion;
            base.Address = address;
            base.Binding = binding;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:10,代码来源:AnnouncementEndpoint.cs

示例12: GetContract

		static ContractDescription GetContract (DiscoveryVersion discoveryVersion, ServiceDiscoveryMode mode)
		{
			if (discoveryVersion == null)
				throw new ArgumentNullException ("discoveryVersion");
			// Provide different contract type for Adhoc mode and Managed mode, respectively.
			if (mode == ServiceDiscoveryMode.Managed)
				return ContractDescription.GetContract (discoveryVersion.DiscoveryProxyContractType);
			else
				return ContractDescription.GetContract (discoveryVersion.DiscoveryTargetContractType);
		}
开发者ID:nickchal,项目名称:pash,代码行数:10,代码来源:DiscoveryEndpoint.cs

示例13: DiscoveryEndpoint

        public DiscoveryEndpoint(DiscoveryVersion discoveryVersion, ServiceDiscoveryMode discoveryMode, Binding binding, EndpointAddress endpointAddress)
            : base(GetDiscoveryContract(discoveryVersion, discoveryMode))
        {
            base.IsSystemEndpoint = true;
                           
            this.discoveryOperationContextExtension = new DiscoveryOperationContextExtension(TimeSpan.Zero, discoveryMode, discoveryVersion);

            base.Behaviors.Add(new DiscoveryOperationContextExtensionInitializer(this.discoveryOperationContextExtension));
            base.Behaviors.Add(new DiscoveryEndpointValidator());

            base.Address = endpointAddress;
            base.Binding = binding;
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:13,代码来源:DiscoveryEndpoint.cs

示例14: UdpAnnouncementEndpoint

        public UdpAnnouncementEndpoint(DiscoveryVersion discoveryVersion, Uri multicastAddress)
            : base(discoveryVersion)
        {
            if (multicastAddress == null)
            {
                throw FxTrace.Exception.ArgumentNull("multicastAddress");
            }
            if (discoveryVersion == null)
            {
                throw FxTrace.Exception.ArgumentNull("discoveryVersion");
            }

            Initialize(multicastAddress);
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:14,代码来源:UdpAnnouncementEndpoint.cs

示例15: UdpDiscoveryEndpoint

        public UdpDiscoveryEndpoint(DiscoveryVersion discoveryVersion, Uri multicastAddress)
            : base(discoveryVersion, ServiceDiscoveryMode.Adhoc)
        {
            if (multicastAddress == null)
            {
                throw FxTrace.Exception.ArgumentNull("multicastAddress");
            }
            if (discoveryVersion == null)
            {
                throw FxTrace.Exception.ArgumentNull("discoveryVersion");
            }

            // Send replies async to maintain performance
            base.Behaviors.Add(new DispatcherSynchronizationBehavior { AsynchronousSendEnabled = true });

            Initialize(multicastAddress);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:17,代码来源:UdpDiscoveryEndpoint.cs


注:本文中的System.ServiceModel.Discovery.DiscoveryVersion类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。