本文整理汇总了C#中BindingElement类的典型用法代码示例。如果您正苦于以下问题:C# BindingElement类的具体用法?C# BindingElement怎么用?C# BindingElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BindingElement类属于命名空间,在下文中一共展示了BindingElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyConfiguration
public virtual void ApplyConfiguration(BindingElement bindingElement)
{
if (bindingElement == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("bindingElement");
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:BindingElementExtensionElement.cs
示例2: ApplyConfiguration
public override void ApplyConfiguration(BindingElement bindingElement)
{
base.ApplyConfiguration(bindingElement);
System.ServiceModel.Channels.MsmqBindingElementBase base2 = bindingElement as System.ServiceModel.Channels.MsmqBindingElementBase;
if (base2 != null)
{
if (null != this.CustomDeadLetterQueue)
{
base2.CustomDeadLetterQueue = this.CustomDeadLetterQueue;
}
base2.DeadLetterQueue = this.DeadLetterQueue;
base2.Durable = this.Durable;
base2.ExactlyOnce = this.ExactlyOnce;
base2.MaxRetryCycles = this.MaxRetryCycles;
base2.ReceiveContextEnabled = this.ReceiveContextEnabled;
base2.ReceiveErrorHandling = this.ReceiveErrorHandling;
base2.ReceiveRetryCount = this.ReceiveRetryCount;
base2.RetryCycleDelay = this.RetryCycleDelay;
base2.TimeToLive = this.TimeToLive;
base2.UseSourceJournal = this.UseSourceJournal;
base2.UseMsmqTracing = this.UseMsmqTracing;
base2.ValidityDuration = this.ValidityDuration;
this.MsmqTransportSecurity.ApplyConfiguration(base2.MsmqTransportSecurity);
}
}
示例3: ApplyConfiguration
public override void ApplyConfiguration(BindingElement bindingElement)
{
base.ApplyConfiguration(bindingElement);
Msmq.MsmqIntegrationBindingElement binding = bindingElement as Msmq.MsmqIntegrationBindingElement;
binding.SerializationFormat = this.SerializationFormat;
}
示例4: ApplyConfiguration
/// <summary>
/// Applies the content of a specified binding element to this binding configuration element.
/// </summary>
/// <param name="bindingElement">A binding element.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="bindingElement"/> is null.</exception>
public override void ApplyConfiguration(BindingElement bindingElement)
{
base.ApplyConfiguration(bindingElement);
var binding = (GzipMessageEncodingBindingElement)bindingElement;
//TODO: Enable to be able to choose inner encoder
//var propertyInfo = ElementInformation.Properties;
//if (propertyInfo["innerMessageEncoding"].ValueOrigin != PropertyValueOrigin.Default)
//{
// switch (this.InnerMessageEncoding)
// {
// case "binary":
// binding.InnerMessageEncodingBindingElement = new BinaryMessageEncodingBindingElement();
// break;
// default:
// binding.InnerMessageEncodingBindingElement = new TextMessageEncodingBindingElement();
// break;
// }
//}
//Set Reader Quotas
if (ReaderQuotas.ElementInformation.IsPresent)
{
XmlDictionaryReaderQuotasElement elementQuotas = ReaderQuotas;
XmlDictionaryReaderQuotas bindingQuotas = binding.ReaderQuotas;
if (elementQuotas.MaxArrayLength != 0) bindingQuotas.MaxArrayLength = elementQuotas.MaxArrayLength;
if (elementQuotas.MaxBytesPerRead != 0) bindingQuotas.MaxBytesPerRead = elementQuotas.MaxBytesPerRead;
if (elementQuotas.MaxDepth != 0) bindingQuotas.MaxDepth = elementQuotas.MaxDepth;
if (elementQuotas.MaxNameTableCharCount != 0) bindingQuotas.MaxNameTableCharCount = elementQuotas.MaxNameTableCharCount;
if (elementQuotas.MaxStringContentLength != 0) bindingQuotas.MaxStringContentLength = elementQuotas.MaxStringContentLength;
}
}
示例5: InitializeFrom
protected internal override void InitializeFrom(BindingElement bindingElement)
{
base.InitializeFrom(bindingElement);
PrivacyNoticeBindingElement element = (PrivacyNoticeBindingElement) bindingElement;
this.Url = element.Url;
this.Version = element.Version;
}
示例6: InitializeFrom
protected internal override void InitializeFrom(BindingElement bindingElement)
{
base.InitializeFrom(bindingElement);
System.ServiceModel.Channels.MsmqBindingElementBase base2 = bindingElement as System.ServiceModel.Channels.MsmqBindingElementBase;
if (base2 != null)
{
if (null != base2.CustomDeadLetterQueue)
{
this.CustomDeadLetterQueue = base2.CustomDeadLetterQueue;
}
this.DeadLetterQueue = base2.DeadLetterQueue;
this.Durable = base2.Durable;
this.ExactlyOnce = base2.ExactlyOnce;
this.MaxRetryCycles = base2.MaxRetryCycles;
this.ReceiveErrorHandling = base2.ReceiveErrorHandling;
this.ReceiveRetryCount = base2.ReceiveRetryCount;
this.RetryCycleDelay = base2.RetryCycleDelay;
this.TimeToLive = base2.TimeToLive;
this.UseSourceJournal = base2.UseSourceJournal;
if (!base2.ReceiveContextEnabled)
{
this.ReceiveContextEnabled = base2.ReceiveContextEnabled;
}
this.UseMsmqTracing = base2.UseMsmqTracing;
if (base2.ValidityDuration != MsmqDefaults.ValidityDuration)
{
this.ValidityDuration = base2.ValidityDuration;
}
this.MsmqTransportSecurity.InitializeFrom(base2.MsmqTransportSecurity);
}
}
示例7: Main
static void Main(string[] args)
{
try
{
BindingElement[] bindingElements = new BindingElement[2];
bindingElements[0] = new TextMessageEncodingBindingElement();
bindingElements[1] = new HttpTransportBindingElement();
CustomBinding binding = new CustomBinding(bindingElements);
using (Message message = Message.CreateMessage(binding.MessageVersion, "sendMessage", "Message Body"))
{
IChannelFactory<IRequestChannel> factory = binding.BuildChannelFactory<IRequestChannel>(new BindingParameterCollection());
factory.Open();
IRequestChannel requestChannel = factory.CreateChannel(new EndpointAddress("http://localhost:9090/RequestReplyService"));
requestChannel.Open();
Message response = requestChannel.Request(message);
Console.WriteLine("Successful send message!");
Console.WriteLine("Receive a return message, action: {0}, body: {1}", response.Headers.Action, response.GetBody<String>());
requestChannel.Close();
factory.Close();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
finally {
Console.Read();
}
}
示例8: TryCreateMatchingExtension
bool TryCreateMatchingExtension(BindingElement bindingElement, ExtensionElementCollection collection, bool allowDerivedTypes, string assemblyName, out BindingElementExtensionElement result)
{
result = null;
foreach (ExtensionElement element in collection)
{
BindingElementExtensionElement bindingElementExtension = Activator.CreateInstance(Type.GetType(element.Type, true)) as BindingElementExtensionElement;
if (null == bindingElementExtension)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigInvalidExtensionType,
element.Type,
assemblyName,
ConfigurationStrings.BindingElementExtensions)));
}
bool isMatch;
if (allowDerivedTypes)
{
isMatch = bindingElementExtension.BindingElementType.IsAssignableFrom(bindingElement.GetType());
}
else
{
isMatch = bindingElementExtension.BindingElementType.Equals(bindingElement.GetType());
}
if (isMatch)
{
result = bindingElementExtension;
return true;
}
}
return false;
}
示例9: InitializeFrom
protected internal override void InitializeFrom(BindingElement bindingElement)
{
base.InitializeFrom(bindingElement);
WindowsStreamSecurityBindingElement windowsBindingElement
= (WindowsStreamSecurityBindingElement)bindingElement;
SetPropertyValueIfNotDefaultValue(ConfigurationStrings.ProtectionLevel, windowsBindingElement.ProtectionLevel);
}
示例10: ApplyConfiguration
public override void ApplyConfiguration(BindingElement bindingElement)
{
base.ApplyConfiguration(bindingElement);
PrivacyNoticeBindingElement binding = (PrivacyNoticeBindingElement)bindingElement;
binding.Url = this.Url;
binding.Version = this.Version;
}
示例11: InitializeFrom
protected internal override void InitializeFrom(BindingElement bindingElement)
{
base.InitializeFrom(bindingElement);
ByteStreamMessageEncodingBindingElement element = (ByteStreamMessageEncodingBindingElement)bindingElement;
this.InitializeFrom(element.ReaderQuotas);
}
示例12: InitializeFrom
protected override void InitializeFrom(BindingElement bindingElement)
{
base.InitializeFrom(bindingElement);
MakeConnectionBindingElement element = (MakeConnectionBindingElement)bindingElement;
this.InitializeFrom(element);
}
示例13: ApplyConfiguration
public override void ApplyConfiguration(BindingElement bindingElement)
{
base.ApplyConfiguration(bindingElement);
ByteStreamMessageEncodingBindingElement binding = (ByteStreamMessageEncodingBindingElement)bindingElement;
this.ApplyConfiguration(binding.ReaderQuotas);
}
示例14: ApplyConfiguration
public override void ApplyConfiguration(BindingElement bindingElement)
{
base.ApplyConfiguration(bindingElement);
SslStreamSecurityBindingElement sslBindingElement =
(SslStreamSecurityBindingElement)bindingElement;
sslBindingElement.RequireClientCertificate = this.RequireClientCertificate;
}
示例15: ApplyConfiguration
public override void ApplyConfiguration(BindingElement bindingElement)
{
base.ApplyConfiguration(bindingElement);
MakeConnectionBindingElement binding = (MakeConnectionBindingElement)bindingElement;
this.ApplyConfiguration(binding);
}