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


C# BindingElementCollection.Find方法代码示例

本文整理汇总了C#中BindingElementCollection.Find方法的典型用法代码示例。如果您正苦于以下问题:C# BindingElementCollection.Find方法的具体用法?C# BindingElementCollection.Find怎么用?C# BindingElementCollection.Find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BindingElementCollection的用法示例。


在下文中一共展示了BindingElementCollection.Find方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BindingRequiresAuthentication

 static bool BindingRequiresAuthentication(BindingElementCollection elements)
 {
     SecurityBindingElement element = elements.Find<SecurityBindingElement>();
     if (element != null)
     {
         foreach (SecurityTokenParameters parameters in EnumerateNestedTokenParameters(element))
         {
             if (parameters is SspiSecurityTokenParameters)
                 return true;
         }
     }
     return false;
 }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:13,代码来源:InternetClientValidatorBehavior.cs

示例2: Extend

 public BindingElementCollection Extend(BindingElementCollection bindingElementCollection)
 {
     MessageEncodingBindingElement item = bindingElementCollection.Find<MessageEncodingBindingElement>();
     if (item != null)
     {
         ConfigureFromMessageEncodingBindingElement(item);
         int index = bindingElementCollection.IndexOf(item);
         bindingElementCollection.RemoveAt(index);
         bindingElementCollection.Insert(index, this);
         return bindingElementCollection;
     }
     bindingElementCollection.Insert(0, this);
     return bindingElementCollection;
 }
开发者ID:DarkActive,项目名称:daFluorineFx,代码行数:14,代码来源:ExtenderMessageEncodingBindingElement.cs

示例3: TryCreate

 internal static bool TryCreate(BindingElementCollection bindingElements, out Binding binding)
 {
     if (bindingElements == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("bindingElements");
     }
     binding = null;
     ContextBindingElement element = bindingElements.Find<ContextBindingElement>();
     if ((element != null) && (element.ContextExchangeMechanism != ContextExchangeMechanism.HttpCookie))
     {
         Binding binding2;
         BindingElementCollection elements = new BindingElementCollection(bindingElements);
         elements.Remove<ContextBindingElement>();
         if (NetTcpBinding.TryCreate(elements, out binding2))
         {
             NetTcpContextBinding binding3 = new NetTcpContextBinding((NetTcpBinding) binding2) {
                 ContextProtectionLevel = element.ProtectionLevel,
                 ContextManagementEnabled = element.ContextManagementEnabled
             };
             binding = binding3;
         }
     }
     return (binding != null);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:24,代码来源:NetTcpContextBinding.cs

示例4: UsesTransactionFlowProperties

 static bool UsesTransactionFlowProperties(BindingElementCollection bindingElements, ContractDescription contract)
 {
     BindingElementCollection bindingElementCollection = new BindingElementCollection(bindingElements);
     TransactionFlowBindingElement txBE = bindingElementCollection.Find<TransactionFlowBindingElement>();
     if (txBE == null)
     {
         return false;
     }
     return txBE.IsFlowEnabled(contract);
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:10,代码来源:DispatcherBuilder.cs

示例5: EndpointAllowsTransactionFlow

 static bool EndpointAllowsTransactionFlow(ServiceEndpoint endpoint, BindingElementCollection elements)
 {
     TransactionFlowBindingElement flow = elements.Find<TransactionFlowBindingElement>();
     return flow != null && ContractAllowsTransactionFlow(endpoint.Contract);
 }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:5,代码来源:InternetClientValidatorBehavior.cs

示例6: TryCreate

        internal static new bool TryCreate(BindingElementCollection bindingElements, out Binding binding)
        {
            if (bindingElements == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("bindingElements");
            }

            binding = null;

            ContextBindingElement contextBindingElement = bindingElements.Find<ContextBindingElement>();
            if (contextBindingElement != null)
            {
                BindingElementCollection bindingElementsWithoutContext = new BindingElementCollection(bindingElements);
                bindingElementsWithoutContext.Remove<ContextBindingElement>();
                Binding wsHttpBinding;
                if (WSHttpBinding.TryCreate(bindingElementsWithoutContext, out wsHttpBinding))
                {
                    bool allowCookies = ((WSHttpBinding)wsHttpBinding).AllowCookies;
                    if (allowCookies && contextBindingElement.ContextExchangeMechanism == ContextExchangeMechanism.HttpCookie
                        || !allowCookies && contextBindingElement.ContextExchangeMechanism == ContextExchangeMechanism.ContextSoapHeader)
                    {
                        WSHttpContextBinding contextBinding = new WSHttpContextBinding((WSHttpBinding)wsHttpBinding);
                        contextBinding.ContextProtectionLevel = contextBindingElement.ProtectionLevel;
                        contextBinding.ContextManagementEnabled = contextBindingElement.ContextManagementEnabled;
                        binding = contextBinding;
                    }
                }
            }

            return binding != null;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:31,代码来源:WSHttpContextBinding.cs

示例7: TryCreate

 internal static bool TryCreate(BindingElementCollection bindingElements, out Binding binding)
 {
     if (bindingElements == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("bindingElements");
     }
     binding = null;
     ContextBindingElement element = bindingElements.Find<ContextBindingElement>();
     if (element != null)
     {
         Binding binding2;
         BindingElementCollection elements = new BindingElementCollection(bindingElements);
         elements.Remove<ContextBindingElement>();
         if (WSHttpBindingBase.TryCreate(elements, out binding2))
         {
             bool allowCookies = ((WSHttpBinding) binding2).AllowCookies;
             if ((allowCookies && (element.ContextExchangeMechanism == ContextExchangeMechanism.HttpCookie)) || (!allowCookies && (element.ContextExchangeMechanism == ContextExchangeMechanism.ContextSoapHeader)))
             {
                 WSHttpContextBinding binding3 = new WSHttpContextBinding((WSHttpBinding) binding2) {
                     ContextProtectionLevel = element.ProtectionLevel,
                     ContextManagementEnabled = element.ContextManagementEnabled
                 };
                 binding = binding3;
             }
         }
     }
     return (binding != null);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:28,代码来源:WSHttpContextBinding.cs

示例8: TryCreate

        internal static new bool TryCreate(BindingElementCollection bindingElements, out Binding binding)
        {
            if (bindingElements == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("bindingElements");
            }

            binding = null;

            ContextBindingElement contextBindingElement = bindingElements.Find<ContextBindingElement>();
            if (contextBindingElement != null && contextBindingElement.ContextExchangeMechanism != ContextExchangeMechanism.HttpCookie)
            {
                BindingElementCollection bindingElementsWithoutContext = new BindingElementCollection(bindingElements);
                bindingElementsWithoutContext.Remove<ContextBindingElement>();
                Binding netTcpBinding;
                if (NetTcpBinding.TryCreate(bindingElementsWithoutContext, out netTcpBinding))
                {
                    NetTcpContextBinding contextBinding = new NetTcpContextBinding((NetTcpBinding)netTcpBinding);
                    contextBinding.ContextProtectionLevel = contextBindingElement.ProtectionLevel;
                    contextBinding.ContextManagementEnabled = contextBindingElement.ContextManagementEnabled;
                    binding = contextBinding;
                }
            }

            return binding != null;
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:26,代码来源:NetTcpContextBinding.cs


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