Ejemplo n.º 1
0
        private void LoadSearchProviderFromConfig() {
            string searchProvider = SiteSettings.Instance.SearchProvider;

            if (string.IsNullOrEmpty(searchProvider)) {
                Instance = new NullSearchProvider();
                return;
            }

            Type searchProviderType = Type.GetType(searchProvider);
            if (searchProviderType == null) {
                Utils.Throw<NullReferenceException>("Type.GetType(" + searchProvider + ") returned null.");
            }

            Instance = (SearchProviderBase)Activator.CreateInstance(searchProviderType);
            Instance.Init();

            Dashboard.RegisterArea(new SearchDashboardArea());
        }
Ejemplo n.º 2
0
        private void LoadSearchProviderFromConfig()
        {
            string searchProvider = SiteSettings.Instance.SearchProvider;

            if (string.IsNullOrEmpty(searchProvider))
            {
                Instance = new NullSearchProvider();
                return;
            }

            Type searchProviderType = Type.GetType(searchProvider);

            if (searchProviderType == null)
            {
                Utils.Throw <NullReferenceException>("Type.GetType(" + searchProvider + ") returned null.");
            }

            Instance = (SearchProviderBase)Activator.CreateInstance(searchProviderType);
            Instance.Init();

            Dashboard.RegisterArea(new SearchDashboardArea());
        }