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


C# BindingElement类代码示例

本文整理汇总了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);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:25,代码来源:MsmqElementBase.cs

示例3: ApplyConfiguration

        public override void ApplyConfiguration(BindingElement bindingElement)
        {
            base.ApplyConfiguration(bindingElement);

            Msmq.MsmqIntegrationBindingElement binding = bindingElement as Msmq.MsmqIntegrationBindingElement;
            binding.SerializationFormat = this.SerializationFormat;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:MsmqIntegrationElement.cs

示例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;
            }
        }
开发者ID:liquidsnk,项目名称:Aspid,代码行数:39,代码来源:GzipMessageEncodingBindingSection.cs

示例5: InitializeFrom

 protected internal override void InitializeFrom(BindingElement bindingElement)
 {
     base.InitializeFrom(bindingElement);
     PrivacyNoticeBindingElement element = (PrivacyNoticeBindingElement) bindingElement;
     this.Url = element.Url;
     this.Version = element.Version;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:PrivacyNoticeElement.cs

示例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);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:31,代码来源:MsmqElementBase.cs

示例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();
            }
        }
开发者ID:porter1130,项目名称:MyTest,代码行数:33,代码来源:Output.cs

示例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;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:32,代码来源:CustomBindingCollectionElement.cs

示例9: InitializeFrom

 protected internal override void InitializeFrom(BindingElement bindingElement)
 {
     base.InitializeFrom(bindingElement);
     WindowsStreamSecurityBindingElement windowsBindingElement
         = (WindowsStreamSecurityBindingElement)bindingElement;
     SetPropertyValueIfNotDefaultValue(ConfigurationStrings.ProtectionLevel, windowsBindingElement.ProtectionLevel);
 }
开发者ID:uQr,项目名称:referencesource,代码行数:7,代码来源:WindowsStreamSecurityElement.cs

示例10: ApplyConfiguration

 public override void ApplyConfiguration(BindingElement bindingElement)
 {
     base.ApplyConfiguration(bindingElement);
     PrivacyNoticeBindingElement binding = (PrivacyNoticeBindingElement)bindingElement;
     binding.Url = this.Url;
     binding.Version = this.Version;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:PrivacyNoticeElement.cs

示例11: InitializeFrom

        protected internal override void InitializeFrom(BindingElement bindingElement)
        {
            base.InitializeFrom(bindingElement);
            ByteStreamMessageEncodingBindingElement element = (ByteStreamMessageEncodingBindingElement)bindingElement;

            this.InitializeFrom(element.ReaderQuotas);
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:ByteStreamMessageEncodingElement.cs

示例12: InitializeFrom

        protected override void InitializeFrom(BindingElement bindingElement)
        {
            base.InitializeFrom(bindingElement);
            MakeConnectionBindingElement element = (MakeConnectionBindingElement)bindingElement;

            this.InitializeFrom(element);
        }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:7,代码来源:MakeConnectionElement.cs

示例13: ApplyConfiguration

        public override void ApplyConfiguration(BindingElement bindingElement)
        {
            base.ApplyConfiguration(bindingElement);
            ByteStreamMessageEncodingBindingElement binding = (ByteStreamMessageEncodingBindingElement)bindingElement;

            this.ApplyConfiguration(binding.ReaderQuotas);
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:ByteStreamMessageEncodingElement.cs

示例14: ApplyConfiguration

 public override void ApplyConfiguration(BindingElement bindingElement)
 {
     base.ApplyConfiguration(bindingElement);
     SslStreamSecurityBindingElement sslBindingElement = 
         (SslStreamSecurityBindingElement)bindingElement;
     sslBindingElement.RequireClientCertificate = this.RequireClientCertificate;
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:SslStreamSecurityElement.cs

示例15: ApplyConfiguration

        public override void ApplyConfiguration(BindingElement bindingElement)
        {
            base.ApplyConfiguration(bindingElement);
            MakeConnectionBindingElement binding = (MakeConnectionBindingElement)bindingElement;

            this.ApplyConfiguration(binding);
        }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:7,代码来源:MakeConnectionElement.cs


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