Пример #1
0
        private static void LoadProviders()
        {
            // 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)
                    {
                        //Create an instance of the provider and set it to the _provider object...
                        //Currently, this is hard-coded to load the SQLHelpdesk Provider.  In order to add
                        //additional features / providers, look up "Creating Custom Providers" online and
                        //modifiy this section to match (as well as the web.config).
                        _provider = new SQLHelpdeskProvider();

                        //If the provider is null, it managed to slip past our lock or did not instantiate
                        //properly... Throw an new exeception.
                        if (_provider == null)
                        {
                            throw new Exception
                                      ("Loaded Provider returned null during the instantiation process.");
                        }
                    }
                }
            }
        }
Пример #2
0
        private static void LoadProviders()
        {
            // 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)
                    {

                        //Create an instance of the provider and set it to the _provider object...
                        //Currently, this is hard-coded to load the SQLHelpdesk Provider.  In order to add
                        //additional features / providers, look up "Creating Custom Providers" online and
                        //modifiy this section to match (as well as the web.config).
                        _provider = new SQLHelpdeskProvider();

                        //If the provider is null, it managed to slip past our lock or did not instantiate
                        //properly... Throw an new exeception.
                        if (_provider == null)
                            throw new Exception
                                ("Loaded Provider returned null during the instantiation process.");
                    }
                }
            }
        }