示例#1
0
 static void CheckUrlTrackerInstalled()
 {
     try
     {
         if (!_urlTrackerInstalled && Application.SqlHelper != null)
         {
             lock (_lock)
             {
                 _urlTrackerInstalled = UrlTrackerRepository.GetUrlTrackerTableExists();
                 if (!_urlTrackerInstalled)
                 {
                     UrlTrackerRepository.CreateUrlTrackerTable();
                     UrlTrackerInstallerService installer = new UrlTrackerInstallerService() { DontWait = true };
                     try
                     {
                         installer.InstallDashboard();
                     }
                     catch (DashboardAlreadyInstalledException) { }
                 }
                 UrlTrackerRepository.UpdateUrlTrackerTable();
             }
         }
     }
     catch (ArgumentNullException) // Thrown if the umbraco connectionstring is empty
     {
         _execute = false;
     }
 }
示例#2
0
        void context_AcquireRequestState(object sender, EventArgs e)
        {
            try
            {
                if (!_urlTrackerInstalled && Application.SqlHelper != null)
                {
                    lock (_lock)
                    {
                        _urlTrackerInstalled = UrlTrackerRepository.GetUrlTrackerTableExists();
                        if (!_urlTrackerInstalled)
                        {
                            UrlTrackerRepository.CreateUrlTrackerTable();
                            UrlTrackerInstallerService installer = new UrlTrackerInstallerService() { DontWait = true };
                            try
                            {
                                installer.InstallDashboard();
                            }
                            catch (DashboardAlreadyInstalledException) { }
                        }
                        UrlTrackerRepository.UpdateUrlTrackerTable();
                    }
                }
            }
            catch (ArgumentNullException) // Thrown if the umbraco connectionstring is empty
            {
                _execute = false;
            }

            if (_execute)
                UrlTrackerDo("AcquireRequestState", ignoreHttpStatusCode: true);
        }