Exemple #1
0
        private void BuildSecurityCacheProviders()
        {
            SecurityCacheProviderCollectionNode securityCacheCollectionNode = (SecurityCacheProviderCollectionNode)hierarchy.FindNodeByType(typeof(SecurityCacheProviderCollectionNode));

            foreach (SecurityCacheProviderNode cacheProviderNode in securityCacheCollectionNode.Nodes)
            {
                securityConfiguration.SecurityCacheProviders.Add(cacheProviderNode.SecurityCacheProviderData);
            }
        }
        private void ResolveDefaultSecurityCacheNode()
        {
            if ((securitySettings.DefaultSecurityCacheProviderName == null) || (securitySettings.DefaultSecurityCacheProviderName.Length == 0))
            {
                return;
            }

            SecurityCacheProviderCollectionNode nodes = this.Hierarchy.FindNodeByType(this, typeof(SecurityCacheProviderCollectionNode)) as SecurityCacheProviderCollectionNode;

            Debug.Assert(nodes != null, "Could not find the SecurityCacheProviderCollectionNode");
            DefaultSecurityCacheInstance = Hierarchy.FindNodeByName(nodes, securitySettings.DefaultSecurityCacheProviderName) as SecurityCacheProviderNode;
        }
        private void GetSecurityCacheProviders()
        {
            SecurityCacheProviderCollectionNode securityCacheProviders = Hierarchy.FindNodeByType(typeof(SecurityCacheProviderCollectionNode)) as SecurityCacheProviderCollectionNode;

            if (securityCacheProviders == null)
            {
                return;
            }
            if (Object.ReferenceEquals(securitySettings.SecurityCacheProviders, securityCacheProviders.SecurityCacheProviderDataCollection))
            {
                return;
            }

            securitySettings.SecurityCacheProviders.Clear();
            foreach (SecurityCacheProviderData securityCacheProviderData in securityCacheProviders.SecurityCacheProviderDataCollection)
            {
                this.securitySettings.SecurityCacheProviders[securityCacheProviderData.Name] = securityCacheProviderData;
            }
        }
        public SecuritySettingsNode Build()
        {
            SecuritySettingsNode rootNode = new SecuritySettingsNode();

            AuthorizationProviderCollectionNode authorizationProviderCollectionNode = new AuthorizationProviderCollectionNode();
            this.authorizationProviderCollectionNode_ = authorizationProviderCollectionNode;
            settings.AuthorizationProviders.ForEach(new Action<AuthorizationProviderData>(BuildAuthorizationProviders));

            SecurityCacheProviderCollectionNode securityCacheProviderCollectionNode = new SecurityCacheProviderCollectionNode();
            this.securityCacheProviderCollectionNode_ = securityCacheProviderCollectionNode;
            settings.SecurityCacheProviders.ForEach(new Action<SecurityCacheProviderData>(BuildSecurityCacheProviders));

            rootNode.AddNode(authorizationProviderCollectionNode);
            rootNode.AddNode(securityCacheProviderCollectionNode);

            rootNode.DefaultAuthorizationInstance = defaultAuthorizationNode;
            rootNode.DefaultSecurityCacheInstance = defaultSecurityCacheProviderNode;
            return rootNode;
        }
        public SecuritySettingsNode Build()
        {
            SecuritySettingsNode rootNode = new SecuritySettingsNode();

            AuthorizationProviderCollectionNode authorizationProviderCollectionNode = new AuthorizationProviderCollectionNode();

            this.authorizationProviderCollectionNode_ = authorizationProviderCollectionNode;
            settings.AuthorizationProviders.ForEach(new Action <AuthorizationProviderData>(BuildAuthorizationProviders));

            SecurityCacheProviderCollectionNode securityCacheProviderCollectionNode = new SecurityCacheProviderCollectionNode();

            this.securityCacheProviderCollectionNode_ = securityCacheProviderCollectionNode;
            settings.SecurityCacheProviders.ForEach(new Action <SecurityCacheProviderData>(BuildSecurityCacheProviders));

            rootNode.AddNode(authorizationProviderCollectionNode);
            rootNode.AddNode(securityCacheProviderCollectionNode);

            rootNode.DefaultAuthorizationInstance = defaultAuthorizationNode;
            rootNode.DefaultSecurityCacheInstance = defaultSecurityCacheProviderNode;
            return(rootNode);
        }