RequestSecurityTokenResponseCollection.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Security / RequestSecurityTokenResponseCollection.cs / 1 / RequestSecurityTokenResponseCollection.cs

                            //------------------------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------------------------

namespace System.ServiceModel.Security 
{
    using System.ServiceModel; 
    using System.ServiceModel.Channels; 
    using System.IdentityModel.Claims;
    using System.IdentityModel.Policy; 
    using System.Xml;
    using System.Collections.Generic;
    using System.ServiceModel.Security;
    using System.Globalization; 

    sealed class RequestSecurityTokenResponseCollection : BodyWriter 
    { 
        IEnumerable rstrCollection;
        SecurityStandardsManager standardsManager; 

        public RequestSecurityTokenResponseCollection(IEnumerable rstrCollection)
            : this(rstrCollection, SecurityStandardsManager.DefaultInstance)
        {} 

        public RequestSecurityTokenResponseCollection(IEnumerable rstrCollection, SecurityStandardsManager standardsManager) : base(true) 
        { 
            if (rstrCollection == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("rstrCollection"); 
            int index = 0;
            foreach (RequestSecurityTokenResponse rstr in rstrCollection)
            {
                if (rstr == null) 
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(String.Format(CultureInfo.InvariantCulture, "rstrCollection[{0}]", index));
                ++index; 
            } 
            this.rstrCollection = rstrCollection;
            if (standardsManager == null) 
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("standardsManager"));
            }
            this.standardsManager = standardsManager; 
        }
 
        public IEnumerable RstrCollection 
        {
            get 
            {
                return this.rstrCollection;
            }
        } 

        public void WriteTo(XmlWriter writer) 
        { 
            this.standardsManager.TrustDriver.WriteRequestSecurityTokenResponseCollection(this, writer);
        } 

        protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
        {
            WriteTo(writer); 
        }
    } 
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.


                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK