本文整理汇总了C#中System.ServiceModel.Discovery.DiscoveryVersion类的典型用法代码示例。如果您正苦于以下问题:C# DiscoveryVersion类的具体用法?C# DiscoveryVersion怎么用?C# DiscoveryVersion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DiscoveryVersion类属于System.ServiceModel.Discovery命名空间,在下文中一共展示了DiscoveryVersion类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: ProtocolSettings
public ProtocolSettings(DiscoveryVersion discoveryVersion)
{
Utility.IfNullThrowNullArgumentException(discoveryVersion, "discoveryVersion");
this.DiscoveryNamespace = discoveryVersion.Namespace;
this.DiscoveryPrefix = ProtocolStrings.DiscoveryPrefix;
if (discoveryVersion.Namespace == ProtocolStrings.DiscoveryNamespaceApril2005)
{
this.AddressingNamespace = ProtocolStrings.WsaNamespaceAugust2004;
this.SchemeUri = ProtocolStrings.SchemeUriAugust2004;
this.SupportsInclusivePrefixes = false;
}
else
{
this.AddressingNamespace = ProtocolStrings.WsaNamespace10;
this.SchemeUri = ProtocolStrings.SchemeUri11;
this.SupportsInclusivePrefixes = true;
}
}
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:19,代码来源:ProtocolSettings.cs
示例17: ReadXml
internal static EndpointDiscoveryMetadata ReadXml (XmlReader reader, DiscoveryVersion version)
{
if (reader == null)
throw new ArgumentNullException ("reader");
var ret = new EndpointDiscoveryMetadata ();
reader.MoveToContent ();
reader.ReadStartElement ();
reader.MoveToContent ();
// standard members
reader.MoveToContent ();
// it is possible due to InternalVisibleToAttribute...
string addrNS = version.MessageVersion.Addressing.Namespace;
ret.Address = EndpointAddress.ReadFrom (version.MessageVersion.Addressing, reader, "EndpointReference", addrNS);
reader.MoveToContent ();
if (reader.IsStartElement ("Types", version.Namespace))
ret.ContractTypeNames = new Collection<XmlQualifiedName> ((XmlQualifiedName []) reader.ReadElementContentAs (typeof (XmlQualifiedName []), null, "Types", version.Namespace));
reader.MoveToContent ();
if (reader.IsStartElement ("Scopes", version.Namespace))
ret.Scopes = new Collection<Uri> ((Uri []) reader.ReadElementContentAs (typeof (Uri []), null, "Scopes", version.Namespace));
if (reader.IsStartElement ("XAddrs", version.Namespace))
ret.ListenUris = new Collection<Uri> ((Uri []) reader.ReadElementContentAs (typeof (Uri []), null, "XAddrs", version.Namespace));
if (reader.IsStartElement ("MetadataVersion", version.Namespace))
ret.Version = reader.ReadElementContentAsInt ();
// non-standard members
for (reader.MoveToContent (); !reader.EOF && reader.NodeType != XmlNodeType.EndElement; reader.MoveToContent ())
ret.Extensions.Add (XElement.Load (reader));
reader.ReadEndElement ();
return ret;
}
开发者ID:nickchal,项目名称:pash,代码行数:42,代码来源:EndpointDiscoveryMetadata.cs
示例18: EnsureProbeSchema
public static XmlQualifiedName EnsureProbeSchema(DiscoveryVersion discoveryVersion, XmlSchemaSet schemaSet)
{
Fx.Assert(schemaSet != null, "The schemaSet must be non null.");
Fx.Assert(discoveryVersion != null, "The discoveryVersion must be non null.");
// do not find/add ProbeMatch related schema items
SchemaTypes typesFound = SchemaTypes.ProbeMatchType | SchemaTypes.ResolveType;
SchemaElements elementsFound = SchemaElements.XAddrs | SchemaElements.MetadataVersion;
XmlSchema discoverySchema = null;
ICollection discoverySchemas = schemaSet.Schemas(discoveryVersion.Namespace);
if ((discoverySchemas == null) || (discoverySchemas.Count == 0))
{
discoverySchema = CreateSchema(discoveryVersion);
schemaSet.Add(discoverySchema);
}
else
{
foreach (XmlSchema schema in discoverySchemas)
{
discoverySchema = schema;
if (schema.SchemaTypes.Contains(discoveryVersion.Implementation.QualifiedNames.ProbeType))
{
typesFound |= SchemaTypes.ProbeType;
break;
}
LocateSchemaTypes(discoveryVersion, schema, ref typesFound);
LocateSchemaElements(discoveryVersion, schema, ref elementsFound);
}
}
if ((typesFound & SchemaTypes.ProbeType) != SchemaTypes.ProbeType)
{
AddSchemaTypes(discoveryVersion, typesFound, discoverySchema);
AddElements(discoveryVersion, elementsFound, discoverySchema);
schemaSet.Reprocess(discoverySchema);
}
return discoveryVersion.Implementation.QualifiedNames.ProbeType;
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:41,代码来源:SchemaUtility.cs
示例19: Intitialize
void Intitialize(DiscoveryVersion discoveryVersion, SigningCertificateSettings signingStoreSettings)
{
Utility.IfNullThrowNullArgumentException(signingStoreSettings, "signingStoreSettings");
this.secureBindingElement = new CompactSignatureSecurityBindingElement(
discoveryVersion,
signingStoreSettings);
Binding binding = base.Binding;
CustomBinding customBinding = binding as CustomBinding;
if (customBinding == null)
{
customBinding = new CustomBinding(binding);
customBinding.Elements.Insert(0, secureBindingElement);
base.Binding = customBinding;
}
else
{
customBinding.Elements.Insert(0, secureBindingElement);
}
}
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:21,代码来源:UdpSecureDiscoveryEndpoint.cs
示例20: ReadXml
internal static EndpointDiscoveryMetadata ReadXml (XmlReader reader, DiscoveryVersion version)
{
if (reader == null)
throw new ArgumentNullException ("reader");
var ret = new EndpointDiscoveryMetadata ();
reader.MoveToContent ();
if (!reader.IsStartElement ("ProbeMatchType", version.Namespace) || reader.IsEmptyElement)
throw new XmlException ("Non-empty ProbeMatchType element is expected");
reader.ReadStartElement ("ProbeType", version.Namespace);
// standard members
reader.MoveToContent ();
ret.Address = EndpointAddress.ReadFrom (AddressingVersion.WSAddressing10, reader);
reader.MoveToContent ();
bool isEmpty = reader.IsEmptyElement;
ret.ContractTypeNames = new Collection<XmlQualifiedName> ((XmlQualifiedName []) reader.ReadElementContentAs (typeof (XmlQualifiedName []), null, "Types", version.Namespace));
reader.MoveToContent ();
if (reader.IsStartElement ("Scopes", version.Namespace))
ret.Scopes = new Collection<Uri> ((Uri []) reader.ReadElementContentAs (typeof (Uri []), null, "Scopes", version.Namespace));
if (reader.IsStartElement ("XAddrs", version.Namespace))
ret.ListenUris = new Collection<Uri> ((Uri []) reader.ReadElementContentAs (typeof (Uri []), null, "XAddrs", version.Namespace));
if (reader.IsStartElement ("MetadataVersion", version.Namespace))
ret.Version = reader.ReadElementContentAsInt ();
// non-standard members
for (reader.MoveToContent (); !reader.EOF && reader.NodeType != XmlNodeType.EndElement; reader.MoveToContent ())
ret.Extensions.Add (XElement.Load (reader));
reader.ReadEndElement ();
return ret;
}
开发者ID:afaerber,项目名称:mono,代码行数:38,代码来源:EndpointDiscoveryMetadata.cs
注:本文中的System.ServiceModel.Discovery.DiscoveryVersion类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论