DefaultAuthorizationContext.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Policy / DefaultAuthorizationContext.cs / 1305376 / DefaultAuthorizationContext.cs

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

namespace System.IdentityModel.Policy 
{
    using System.Collections.Generic; 
    using System.Collections.ObjectModel; 
    using System.IdentityModel.Claims;
 
    class DefaultAuthorizationContext : AuthorizationContext
    {
        static DefaultAuthorizationContext empty;
        SecurityUniqueId id; 
        ReadOnlyCollection claimSets;
        DateTime expirationTime; 
        IDictionary properties; 

        public DefaultAuthorizationContext(DefaultEvaluationContext evaluationContext) 
        {
            this.claimSets = evaluationContext.ClaimSets;
            this.expirationTime = evaluationContext.ExpirationTime;
            this.properties = evaluationContext.Properties; 
        }
 
        public static DefaultAuthorizationContext Empty 
        {
            get 
            {
                if (empty == null)
                    empty = new DefaultAuthorizationContext(new DefaultEvaluationContext());
                return empty; 
            }
        } 
 
        public override string Id
        { 
            get
            {
                if (this.id == null)
                    this.id = SecurityUniqueId.Create(); 
                return this.id.Value;
            } 
        } 

        public override ReadOnlyCollection ClaimSets 
        {
            get { return this.claimSets; }
        }
 
        public override DateTime ExpirationTime
        { 
            get { return this.expirationTime; } 
        }
 
        public override IDictionary Properties
        {
            get { return this.properties; }
        } 
    }
} 

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

namespace System.IdentityModel.Policy 
{
    using System.Collections.Generic; 
    using System.Collections.ObjectModel; 
    using System.IdentityModel.Claims;
 
    class DefaultAuthorizationContext : AuthorizationContext
    {
        static DefaultAuthorizationContext empty;
        SecurityUniqueId id; 
        ReadOnlyCollection claimSets;
        DateTime expirationTime; 
        IDictionary properties; 

        public DefaultAuthorizationContext(DefaultEvaluationContext evaluationContext) 
        {
            this.claimSets = evaluationContext.ClaimSets;
            this.expirationTime = evaluationContext.ExpirationTime;
            this.properties = evaluationContext.Properties; 
        }
 
        public static DefaultAuthorizationContext Empty 
        {
            get 
            {
                if (empty == null)
                    empty = new DefaultAuthorizationContext(new DefaultEvaluationContext());
                return empty; 
            }
        } 
 
        public override string Id
        { 
            get
            {
                if (this.id == null)
                    this.id = SecurityUniqueId.Create(); 
                return this.id.Value;
            } 
        } 

        public override ReadOnlyCollection ClaimSets 
        {
            get { return this.claimSets; }
        }
 
        public override DateTime ExpirationTime
        { 
            get { return this.expirationTime; } 
        }
 
        public override IDictionary Properties
        {
            get { return this.properties; }
        } 
    }
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

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