Example #1
0
        /// <summary>
        /// 
        /// </summary>
        static Common()
        {
            /* ensure assemblies are loaded
             * this loads assemblies that may not be loaded because they have not direct reference
             * but need to be loaded because they may contain modules and portlets
             */
            EnsureAssembliesAreLoaded();

            _cacheManager = new CacheManager();

            // providers
            _databaseProvider = Databases.Provider as PortalDatabaseProvider;
            _pathProvider = CommunityPaths.Provider;
            _configurationProvider = CommunityConfigurations.Provider;
            _membershipProvider = global::System.Web.Security.Membership.Provider;
            _roleProvider = global::System.Web.Security.Roles.Provider;
        }
Example #2
0
        static CommunityPaths()
        {
            // avoid claiming lock if providers are already loaded
            if (_provider == null)
            {
                lock (_lock)
                {
                    // do this again to make sure _provider is still null
                    if (_provider == null)
                    {
                        // get a reference to the <configurationManager> section
                        CommunityPathManagerSection section = WebConfigurationManager.GetSection("managedFusion/communityPathManager") as CommunityPathManagerSection;

                        // Load registered providers and point _provider to the default provider
                        _providers = new CommunityPathProviderCollection();
                        ProvidersHelper.InstantiateProviders(section.Providers, _providers, typeof(CommunityPathProvider));
                        _provider = _providers[section.DefaultProvider];

                        if (_provider == null)
                            throw new ProviderException("Unable to load default CommunityPathProvider");
                    }
                }
            }
        }