• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Description.MetadataImporter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.ServiceModel.Description.MetadataImporter的典型用法代码示例。如果您正苦于以下问题:C# MetadataImporter类的具体用法?C# MetadataImporter怎么用?C# MetadataImporter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MetadataImporter类属于System.ServiceModel.Description命名空间,在下文中一共展示了MetadataImporter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ArgumentNullException

        void IPolicyImportExtension.ImportPolicy(MetadataImporter importer, PolicyConversionContext context)
        {
            if (importer == null)
            {
                throw new ArgumentNullException("importer");
            }

            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            ICollection<XmlElement> assertions = context.GetBindingAssertions();

            foreach (XmlElement assertion in assertions)
            {
                if (assertion.NamespaceURI == MakeConnectionConstants.Namespace)
                {
                    if (assertion.LocalName == MakeConnectionConstants.Policy.Assertion)
                    {
                        assertions.Remove(assertion);
                        context.BindingElements.Insert(0, new MakeConnectionBindingElement());
                        return;
                    }
                }
            }
        }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:27,代码来源:MakeConnectionBindingElementImporter.cs


示例2: ProcessReliableSession11Assertion

 private static void ProcessReliableSession11Assertion(MetadataImporter importer, XmlElement element, ReliableSessionBindingElement settings)
 {
     settings.ReliableMessagingVersion = ReliableMessagingVersion.WSReliableMessaging11;
     IEnumerator nodes = element.ChildNodes.GetEnumerator();
     System.Xml.XmlNode node = SkipToNode(nodes);
     ProcessWsrm11Policy(importer, node, settings);
     node = SkipToNode(nodes);
     State inactivityTimeout = State.InactivityTimeout;
     while (node != null)
     {
         if ((inactivityTimeout == State.InactivityTimeout) && Is11Assertion(node, "InactivityTimeout"))
         {
             SetInactivityTimeout(settings, ReadMillisecondsAttribute(node, true), node.LocalName);
             inactivityTimeout = State.AcknowledgementInterval;
             node = SkipToNode(nodes);
         }
         else
         {
             if (Is11Assertion(node, "AcknowledgementInterval"))
             {
                 SetAcknowledgementInterval(settings, ReadMillisecondsAttribute(node, true), node.LocalName);
                 return;
             }
             if (inactivityTimeout == State.AcknowledgementInterval)
             {
                 return;
             }
             node = SkipToNode(nodes);
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:31,代码来源:ReliableSessionBindingElementImporter.cs


示例3: TryImportWsspHttpsTokenAssertion

 public override bool TryImportWsspHttpsTokenAssertion(MetadataImporter importer, ICollection<XmlElement> assertions, HttpsTransportBindingElement httpsBinding)
 {
     XmlElement element;
     if (assertions == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("assertions");
     }
     if (this.TryImportWsspAssertion(assertions, "HttpsToken", out element))
     {
         bool flag = true;
         string attribute = element.GetAttribute("RequireClientCertificate");
         try
         {
             httpsBinding.RequireClientCertificate = XmlUtil.IsTrue(attribute);
         }
         catch (Exception exception)
         {
             if (Fx.IsFatal(exception))
             {
                 throw;
             }
             if (exception is NullReferenceException)
             {
                 throw;
             }
             importer.Errors.Add(new MetadataConversionError(System.ServiceModel.SR.GetString("UnsupportedBooleanAttribute", new object[] { "RequireClientCertificate", exception.Message }), false));
             flag = false;
         }
         return flag;
     }
     return false;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:32,代码来源:WSSecurityPolicy11.cs


示例4: OnImportPolicy

        internal void OnImportPolicy(MetadataImporter importer, PolicyConversionContext context)
        {
            XmlElement element = PolicyConversionContext.FindAssertion(context.GetBindingAssertions(),
                                    PeerTransportPolicyConstants.PeerTransportSecurityMode,
                                    TransportPolicyConstants.PeerTransportUri, true);

            this.Mode = SecurityMode.Transport;
            if (element != null)
            {
                switch (element.InnerText)
                {
                    case PeerTransportPolicyConstants.PeerTransportSecurityModeNone:
                        this.Mode = SecurityMode.None;
                        break;
                    case PeerTransportPolicyConstants.PeerTransportSecurityModeTransport:
                        this.Mode = SecurityMode.Transport;
                        break;
                    case PeerTransportPolicyConstants.PeerTransportSecurityModeMessage:
                        this.Mode = SecurityMode.Message;
                        break;
                    case PeerTransportPolicyConstants.PeerTransportSecurityModeTransportWithMessageCredential:
                        this.Mode = SecurityMode.TransportWithMessageCredential;
                        break;
                    default:
                        break;
                }
            }
            transportSecurity.OnImportPolicy(importer, context);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:29,代码来源:peersecuritysettings.cs


示例5: PrivacyNoticeBindingElement

        void IPolicyImportExtension.ImportPolicy(MetadataImporter importer, PolicyConversionContext policyContext)
        {
            if (policyContext == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("policyContext");

            XmlElement privacyNoticeAssertion = PolicyConversionContext.FindAssertion(policyContext.GetBindingAssertions(),
                PrivacyNoticePolicyStrings.PrivacyNoticeName, PrivacyNoticePolicyStrings.PrivacyNoticeNamespace, true);
            if (privacyNoticeAssertion != null)
            {
                PrivacyNoticeBindingElement settings =
                    policyContext.BindingElements.Find<PrivacyNoticeBindingElement>();

                if (null == settings)
                {
                    settings = new PrivacyNoticeBindingElement();
                    policyContext.BindingElements.Add(settings);
                }

                settings.Url = new Uri(privacyNoticeAssertion.InnerText);
                string versionString = privacyNoticeAssertion.GetAttribute(PrivacyNoticePolicyStrings.PrivacyNoticeVersionAttributeName, PrivacyNoticePolicyStrings.PrivacyNoticeNamespace);
                if (string.IsNullOrEmpty(versionString))
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.CannotImportPrivacyNoticeElementWithoutVersionAttribute)));
                }

                int version = 0;
                if (!Int32.TryParse(versionString, out version))
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.PrivacyNoticeElementVersionAttributeInvalid)));
                }
                settings.Version = version;
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:33,代码来源:PrivacyNoticeBindingElementImporter.cs


示例6: PrivacyNoticeBindingElement

 void IPolicyImportExtension.ImportPolicy(MetadataImporter importer, PolicyConversionContext policyContext)
 {
     if (policyContext == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("policyContext");
     }
     XmlElement element = PolicyConversionContext.FindAssertion(policyContext.GetBindingAssertions(), "PrivacyNotice", "http://schemas.xmlsoap.org/ws/2005/05/identity", true);
     if (element != null)
     {
         PrivacyNoticeBindingElement item = policyContext.BindingElements.Find<PrivacyNoticeBindingElement>();
         if (item == null)
         {
             item = new PrivacyNoticeBindingElement();
             policyContext.BindingElements.Add(item);
         }
         item.Url = new Uri(element.InnerText);
         string attribute = element.GetAttribute("Version", "http://schemas.xmlsoap.org/ws/2005/05/identity");
         if (string.IsNullOrEmpty(attribute))
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("CannotImportPrivacyNoticeElementWithoutVersionAttribute")));
         }
         int result = 0;
         if (!int.TryParse(attribute, out result))
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("PrivacyNoticeElementVersionAttributeInvalid")));
         }
         item.Version = result;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:29,代码来源:PrivacyNoticeBindingElementImporter.cs


示例7: OnImportPolicy

 internal void OnImportPolicy(MetadataImporter importer, PolicyConversionContext context)
 {
     string str;
     XmlElement element = PolicyConversionContext.FindAssertion(context.GetBindingAssertions(), "PeerTransportSecurityMode", "http://schemas.microsoft.com/soap/peer", true);
     this.Mode = SecurityMode.Transport;
     if ((element != null) && ((str = element.InnerText) != null))
     {
         if (!(str == "PeerTransportSecurityModeNone"))
         {
             if (str == "PeerTransportSecurityModeTransport")
             {
                 this.Mode = SecurityMode.Transport;
             }
             else if (str == "PeerTransportSecurityModeMessage")
             {
                 this.Mode = SecurityMode.Message;
             }
             else if (str == "PeerTransportSecurityModeTransportWithMessageCredential")
             {
                 this.Mode = SecurityMode.TransportWithMessageCredential;
             }
         }
         else
         {
             this.Mode = SecurityMode.None;
         }
     }
     this.transportSecurity.OnImportPolicy(importer, context);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:29,代码来源:PeerSecuritySettings.cs


示例8: ArgumentNullException

        void IPolicyImportExtension.ImportPolicy(MetadataImporter importer, PolicyConversionContext context)
        {
            if (importer == null)
            {
                throw new ArgumentNullException("importer");
            }

            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            ICollection<XmlElement> assertions = context.GetBindingAssertions();
            foreach (XmlElement assertion in assertions)
            {
                if ((assertion.NamespaceURI == GZipMessageEncodingPolicyConstants.GZipEncodingNamespace) &&
                    (assertion.LocalName == GZipMessageEncodingPolicyConstants.GZipEncodingName)
                    )
                {
                    assertions.Remove(assertion);
                    context.BindingElements.Add(new GZipMessageEncodingBindingElement());
                    break;
                }
            }
        }
开发者ID:spzenk,项目名称:sfdocsamples,代码行数:25,代码来源:GZipMessageEncodingBindingElementImporter.cs


示例9: if

 void IPolicyImportExtension.ImportPolicy(MetadataImporter importer, PolicyConversionContext context)
 {
     if (importer == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("importer");
     }
     if (context == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
     }
     XmlElement element = PolicyConversionContext.FindAssertion(context.GetBindingAssertions(), "OneWay", "http://schemas.microsoft.com/ws/2005/05/routing/policy", true);
     if (element != null)
     {
         OneWayBindingElement item = new OneWayBindingElement();
         context.BindingElements.Add(item);
         for (int i = 0; i < element.ChildNodes.Count; i++)
         {
             System.Xml.XmlNode node = element.ChildNodes[i];
             if (((node != null) && (node.NodeType == XmlNodeType.Element)) && ((node.NamespaceURI == "http://schemas.microsoft.com/ws/2005/05/routing/policy") && (node.LocalName == "PacketRoutable")))
             {
                 item.PacketRoutable = true;
                 return;
             }
         }
     }
     else if (WsdlImporter.WSAddressingHelper.DetermineSupportedAddressingMode(importer, context) == SupportedAddressingMode.NonAnonymous)
     {
         context.BindingElements.Add(new OneWayBindingElement());
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:30,代码来源:OneWayBindingElementImporter.cs


示例10: ArgumentNullException

        void IPolicyImportExtension.ImportPolicy(MetadataImporter importer, PolicyConversionContext context)
        {
            if (importer == null)
            {
                throw new ArgumentNullException("importer");
            }
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            UdpTransportBindingElement udpBindingElement = null;
            bool multicast = false;
            PolicyAssertionCollection policyAssertions = context.GetBindingAssertions();
            if (policyAssertions.Remove(UdpPolicyStrings.TransportAssertion, UdpPolicyStrings.UdpNamespace) != null)
            {
                udpBindingElement = new UdpTransportBindingElement();
            }
            if (policyAssertions.Remove(UdpPolicyStrings.MulticastAssertion, UdpPolicyStrings.UdpNamespace) != null)
            {
                multicast = true;
            }
            if (udpBindingElement != null)
            {
                udpBindingElement.Multicast = multicast;
                context.BindingElements.Add(udpBindingElement);
            }
        }
开发者ID:tian1ll1,项目名称:WPF_Examples,代码行数:28,代码来源:UdpBindingElementImporter.cs


示例11: OnImportPolicy

		protected virtual void OnImportPolicy (XmlElement assertion,
			MessageVersion messageVersion,
			MetadataImporter exporter,
			PolicyConversionContext context)
		{
			throw new NotImplementedException ();
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:7,代码来源:MessageEncodingBindingElement.cs


示例12: TryImportWsspHttpsTokenAssertion

        public override bool TryImportWsspHttpsTokenAssertion(MetadataImporter importer, ICollection<XmlElement> assertions, HttpsTransportBindingElement httpsBinding)
        {
            if (assertions == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("assertions");
            }

            bool result = true;
            XmlElement assertion;

            if (TryImportWsspAssertion(assertions, HttpsTokenName, out assertion))
            {
                XmlElement policyElement = null;
                foreach (XmlNode node in assertion.ChildNodes)
                {
                    if (node is XmlElement && node.LocalName == WSSecurityPolicy.PolicyName && (node.NamespaceURI == WSSecurityPolicy.WspNamespace || node.NamespaceURI == WSSecurityPolicy.Wsp15Namespace))
                    {
                        policyElement = (XmlElement)node;
                        break;
                    }
                }

                if (policyElement != null)
                {
                    foreach (XmlNode node in policyElement.ChildNodes)
                    {
                        if (node is XmlElement && node.NamespaceURI == this.WsspNamespaceUri)
                        {
                            if (node.LocalName == WSSecurityPolicy.RequireClientCertificateName)
                            {
                                httpsBinding.RequireClientCertificate = true;
                            }
                            else if (node.LocalName == WSSecurityPolicy.HttpBasicAuthenticationName)
                            {
                                httpsBinding.AuthenticationScheme = AuthenticationSchemes.Basic;
                            }
                            else if (node.LocalName == WSSecurityPolicy.HttpDigestAuthenticationName)
                            {
                                httpsBinding.AuthenticationScheme = AuthenticationSchemes.Digest;
                            }
                        }
                    }
                }
            }
            else
            {
                result = false;
            }

            return result;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:51,代码来源:WSSecurityPolicy12.cs


示例13: ImportPolicy

        public void ImportPolicy(MetadataImporter importer, PolicyConversionContext context)
        {
            XmlQualifiedName wsdlBindingQName;
            string transportUri = WsdlImporter.SoapInPolicyWorkaroundHelper.FindAdHocPolicy(context, this.udpTransportUriKey, out wsdlBindingQName);

            if (transportUri != null && transportUri.Equals(UdpConstants.WsdlSoapUdpTransportUri, StringComparison.Ordinal) && !context.BindingElements.Contains(typeof(TransportBindingElement)))
            {
                UdpTransportBindingElement transport = new UdpTransportBindingElement();
                ((ITransportPolicyImport)transport).ImportPolicy(importer, context);

                StateHelper.RegisterTransportBindingElement(importer, wsdlBindingQName);
                context.BindingElements.Add(transport);
            }
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:14,代码来源:UdpTransportImporter.cs


示例14: ArgumentNullException

        void IPolicyImportExtension.ImportPolicy(MetadataImporter importer, PolicyConversionContext context)
        {
            if (importer == null)
            {
                throw new ArgumentNullException("importer");
            }

            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            ICollection<XmlElement> bindingAssertions = context.GetBindingAssertions();
            List<XmlElement> processedAssertions = new List<XmlElement>();
            UdpTransportBindingElement udpBindingElement = null;
            bool multicast = false;
            foreach (XmlElement assertion in bindingAssertions)
            {
                if (assertion.NamespaceURI != UdpPolicyStrings.UdpNamespace)
                {
                    continue;
                }

                switch (assertion.LocalName)
                {
                    case UdpPolicyStrings.TransportAssertion:
                        udpBindingElement = new UdpTransportBindingElement();
                        break;
                    case UdpPolicyStrings.MulticastAssertion:
                        multicast = true;
                        break;
                    default:
                        continue;
                }

                processedAssertions.Add(assertion);
            }

            if (udpBindingElement != null)
            {
                udpBindingElement.Multicast = multicast;
                context.BindingElements.Add(udpBindingElement);
            }

            for (int i = 0; i < processedAssertions.Count; i++)
            {
                bindingAssertions.Remove(processedAssertions[i]);
            }
        }
开发者ID:ssickles,项目名称:archive,代码行数:49,代码来源:UdpBindingElementConverter.cs


示例15: CompositeDuplexBindingElement

 void IPolicyImportExtension.ImportPolicy(MetadataImporter importer, PolicyConversionContext context)
 {
     if (importer == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("importer");
     }
     if (context == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
     }
     if ((PolicyConversionContext.FindAssertion(context.GetBindingAssertions(), "CompositeDuplex", "http://schemas.microsoft.com/net/2006/06/duplex", true) != null) || (WsdlImporter.WSAddressingHelper.DetermineSupportedAddressingMode(importer, context) == SupportedAddressingMode.NonAnonymous))
     {
         context.BindingElements.Add(new CompositeDuplexBindingElement());
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:CompositeDuplexBindingElementImporter.cs


示例16: ImportOperationScopeSupportingTokensPolicy

        void ImportOperationScopeSupportingTokensPolicy(MetadataImporter importer, PolicyConversionContext policyContext, SecurityBindingElement binding)
        {
            foreach (OperationDescription operation in policyContext.Contract.Operations)
            {
                string requestAction = null;
                foreach (MessageDescription message in operation.Messages)
                {
                    if (message.Direction == MessageDirection.Input)
                    {
                        requestAction = message.Action;
                        break;
                    }
                }

                SupportingTokenParameters requirements = new SupportingTokenParameters();
                SupportingTokenParameters optionalRequirements = new SupportingTokenParameters();
                ICollection<XmlElement> operationBindingAssertions = policyContext.GetOperationBindingAssertions(operation);
                this.ImportSupportingTokenAssertions(importer, policyContext, operationBindingAssertions, requirements, optionalRequirements);
                if (requirements.Endorsing.Count > 0
                    || requirements.Signed.Count > 0
                    || requirements.SignedEncrypted.Count > 0
                    || requirements.SignedEndorsing.Count > 0)
                {
                    if (requestAction != null)
                    {
                        binding.OperationSupportingTokenParameters[requestAction] = requirements;
                    }
                    else
                    {
                        throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.CannotImportSupportingTokensForOperationWithoutRequestAction)));
                    }
                }
                if (optionalRequirements.Endorsing.Count > 0
                    || optionalRequirements.Signed.Count > 0
                    || optionalRequirements.SignedEncrypted.Count > 0
                    || optionalRequirements.SignedEndorsing.Count > 0)
                {
                    if (requestAction != null)
                    {
                        binding.OptionalOperationSupportingTokenParameters[requestAction] = optionalRequirements;
                    }
                    else
                    {
                        throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.CannotImportSupportingTokensForOperationWithoutRequestAction)));
                    }
                }
            }
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:48,代码来源:SecurityBindingElementImporter.cs


示例17: MtomMessageEncodingBindingElement

		void IPolicyImportExtension.ImportPolicy (MetadataImporter importer,
			PolicyConversionContext context)
		{
			var assertions = context.GetBindingAssertions ();

			var mtom = PolicyImportHelper.GetMtomMessageEncodingPolicy (assertions);
			if (mtom != null) {
				// http://www.w3.org/Submission/WS-MTOMPolicy/
				context.BindingElements.Add (new MtomMessageEncodingBindingElement ());
				return;
			}

			var binary = PolicyImportHelper.GetBinaryMessageEncodingPolicy (assertions);
			if (binary != null) {
				context.BindingElements.Add (new BinaryMessageEncodingBindingElement ());
				return;
			}

			context.BindingElements.Add (new TextMessageEncodingBindingElement ());
		}
开发者ID:nlhepler,项目名称:mono,代码行数:20,代码来源:MessageEncodingBindingElementImporter.cs


示例18: UseManagedPresentationBindingElement

        void IPolicyImportExtension.ImportPolicy(MetadataImporter importer, PolicyConversionContext policyContext)
        {
            if (policyContext == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("policyContext");

            XmlElement useManagedPresentationAssertion = PolicyConversionContext.FindAssertion(policyContext.GetBindingAssertions(),
                UseManagedPresentationPolicyStrings.RequireFederatedIdentityProvisioningName, UseManagedPresentationPolicyStrings.UseManagedPresentationNamespace, true);
            if (useManagedPresentationAssertion != null)
            {
                UseManagedPresentationBindingElement settings =
                    policyContext.BindingElements.Find<UseManagedPresentationBindingElement>();

                if (null == settings)
                {
                    settings = new UseManagedPresentationBindingElement();
                    policyContext.BindingElements.Add(settings);
                }
            }

        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:20,代码来源:UseManagedPresentationBindingElementImporter.cs


示例19: GetReliableSessionBindingElement

        void IPolicyImportExtension.ImportPolicy(MetadataImporter importer, PolicyConversionContext context)
        {
            if (importer == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("importer");
            }

            if (context == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
            }

            bool gotAssertion = false;

            XmlElement reliableSessionAssertion = PolicyConversionContext.FindAssertion(context.GetBindingAssertions(),
                ReliableSessionPolicyStrings.ReliableSessionName,
                ReliableSessionPolicyStrings.ReliableSessionFebruary2005Namespace, true);

            if (reliableSessionAssertion != null)
            {
                ProcessReliableSessionFeb2005Assertion(reliableSessionAssertion, GetReliableSessionBindingElement(context));
                gotAssertion = true;
            }

            reliableSessionAssertion = PolicyConversionContext.FindAssertion(context.GetBindingAssertions(),
                ReliableSessionPolicyStrings.ReliableSessionName,
                ReliableSessionPolicyStrings.ReliableSession11Namespace, true);

            if (reliableSessionAssertion != null)
            {
                if (gotAssertion)
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidChannelBindingException(
                        SR.GetString(SR.MultipleVersionsFoundInPolicy,
                        ReliableSessionPolicyStrings.ReliableSessionName)));
                }

                ProcessReliableSession11Assertion(importer, reliableSessionAssertion,
                    GetReliableSessionBindingElement(context));
            }
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:41,代码来源:ReliableSessionBindingElementImporter.cs


示例20: OnImportPolicy

 internal void OnImportPolicy(MetadataImporter importer, PolicyConversionContext context)
 {
     string str;
     XmlElement element = PolicyConversionContext.FindAssertion(context.GetBindingAssertions(), "PeerTransportCredentialType", "http://schemas.microsoft.com/soap/peer", true);
     PeerTransportCredentialType password = PeerTransportCredentialType.Password;
     if ((element != null) && ((str = element.InnerText) != null))
     {
         if (!(str == "PeerTransportCredentialTypePassword"))
         {
             if (str == "PeerTransportCredentialTypeCertificate")
             {
                 password = PeerTransportCredentialType.Certificate;
             }
         }
         else
         {
             password = PeerTransportCredentialType.Password;
         }
     }
     this.CredentialType = password;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:21,代码来源:PeerTransportSecuritySettings.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Description.MetadataSet类代码示例发布时间:2022-05-26
下一篇:
C# Description.MetadataExporter类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap