//
        // Summary:
        //  Marshals the PolicyElement to it's native format.
        //
        // Parameters:
        //  ptr  - A pointer to native memory in which to place the native format of the PolicyElement.  Must be
        //         a buffer atleast as large as this.Size.
        //
        public void DoMarshal(IntPtr ptr)
        {
            string target = m_element.Target.OuterXml;
            string issuer = "";

            IDT.DebugAssert(IntPtr.Zero == m_nativePtr, "Pointer already assigned");

            m_nativePtr = ptr;
            if (m_element.Issuer != null)
            {
                issuer = m_element.Issuer.OuterXml;
            }
            string tokenParameters = string.Empty;

            if (null != m_element.Parameters)
            {
                tokenParameters = CardSpaceSelector.XmlToString(m_element.Parameters);
            }

            m_nativeElement.targetEndpointAddress = target;
            m_nativeElement.issuerEndpointAddress = issuer;
            m_nativeElement.issuedTokenParameters = tokenParameters;
            m_nativeElement.policyNoticeLink      = null != m_element.PolicyNoticeLink ? m_element.PolicyNoticeLink.ToString() : null;
            m_nativeElement.policyNoticeVersion   = m_element.PolicyNoticeVersion;
            m_nativeElement.isManagedCardProvider = m_element.IsManagedIssuer;

            Marshal.StructureToPtr(m_nativeElement, ptr, false);

            return;
        }
示例#2
0
        public void DoMarshal(IntPtr ptr)
        {
            string outerXml = this.m_element.Target.OuterXml;
            string str2     = "";

            this.m_nativePtr = ptr;
            if (this.m_element.Issuer != null)
            {
                str2 = this.m_element.Issuer.OuterXml;
            }
            string str3 = string.Empty;

            if (this.m_element.Parameters != null)
            {
                str3 = CardSpaceSelector.XmlToString(this.m_element.Parameters);
            }
            this.m_nativeElement.targetEndpointAddress = outerXml;
            this.m_nativeElement.issuerEndpointAddress = str2;
            this.m_nativeElement.issuedTokenParameters = str3;
            this.m_nativeElement.policyNoticeLink      = (null != this.m_element.PolicyNoticeLink) ? this.m_element.PolicyNoticeLink.ToString() : null;
            this.m_nativeElement.policyNoticeVersion   = this.m_element.PolicyNoticeVersion;
            this.m_nativeElement.isManagedCardProvider = this.m_element.IsManagedIssuer;
            Marshal.StructureToPtr(this.m_nativeElement, ptr, false);
        }