當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。