コード例 #1
0
        public void LogInfo(string message, string sourceText, string eventCodeText, bool logToEventLog)
        {
            string value = state + AbstractImportExportSettings.SEPARATOR + message + content;

            PersistentStorageHelper.SetValue(STORAGE_KEY, value);
            if (logToEventLog)
            {
                EventLogProvider.LogEvent(EventType.INFORMATION, sourceText, eventCodeText, message, RequestContext.CurrentURL);
            }
        }
コード例 #2
0
        public void LogWarning(string message, string sourceText, string eventCodeText, bool logToEventLog)
        {
            string value = state + AbstractImportExportSettings.SEPARATOR + "<span class=\"SelectorError\">" + message + "</span>" + content;

            PersistentStorageHelper.SetValue(STORAGE_KEY, value);
            if (logToEventLog)
            {
                EventLogProvider.LogEvent(EventType.ERROR, sourceText, eventCodeText, message, RequestContext.CurrentURL);
            }
        }
コード例 #3
0
        public void LogQuit(string message, string sourceText, string eventCodeText, bool logToEventLog)
        {
            string value = QUIT_SIGN + AbstractImportExportSettings.SEPARATOR + message + content;

            PersistentStorageHelper.SetValue(STORAGE_KEY, value);
            if (logToEventLog)
            {
                new EventLogProvider().LogEvent(EventLogProvider.EVENT_TYPE_INFORMATION, DateTime.Now, sourceText, eventCodeText, URLHelper.CurrentURL, message);
            }
        }
コード例 #4
0
        public void LogError(string message, string sourceText, string eventCodeText, bool logToEventLog)
        {
            string value = FAILED_SIGN + AbstractImportExportSettings.SEPARATOR + "<span class=\"SelectorError\">" + message + "</span>" + content;

            PersistentStorageHelper.SetValue(STORAGE_KEY, value);
            if (logToEventLog)
            {
                new EventLogProvider().LogEvent(EventLogProvider.EVENT_TYPE_ERROR, DateTime.Now, sourceText, eventCodeText, URLHelper.CurrentURL, message);
            }
        }
コード例 #5
0
    /// <summary>
    /// Takes all sites offline.
    /// </summary>
    private void TakeSitesOffline()
    {
        var sites   = SiteInfoProvider.GetSites("(SiteIsOffline IS NULL) OR (SiteIsOffline = 0)", null);
        var siteIDs = new List <int>(sites.Items.Count);

        foreach (var site in sites)
        {
            site.SiteIsOffline = true;
            SiteInfoProvider.SetSiteInfo(site);
            siteIDs.Add(site.SiteID);
        }
        PersistentStorageHelper.SetValue("SeparateDBSites", siteIDs);
    }
コード例 #6
0
    /// <summary>
    /// Stop tasks.
    /// </summary>
    void btnStopTasks_Click(object sender, EventArgs e)
    {
        // Stop tasks
        PersistentStorageHelper.SetValue("CMSSchedulerTasksEnabled", SettingsKeyInfoProvider.GetBoolValue("CMSSchedulerTasksEnabled"));
        if (SchedulingHelper.EnableScheduler)
        {
            SettingsKeyInfoProvider.SetGlobalValue("CMSSchedulerTasksEnabled", false);
        }

        WinServiceHelper.RestartService(WinServiceHelper.HM_SERVICE_BASENAME, false);

        // Display stopping progress
        iconHelp.Visible = btnStopTasks.Visible = false;
        DisplayStoppingTasks();
        TasksManuallyStopped = true;
    }
コード例 #7
0
        public void LogQuit(string message, string sourceText, string eventCodeText, bool logToEventLog)
        {
            string value = QUIT_SIGN + AbstractImportExportSettings.SEPARATOR + message + content;

            PersistentStorageHelper.SetValue(STORAGE_KEY, value);
            if (logToEventLog)
            {
                var logData = new EventLogData(EventTypeEnum.Information, sourceText, eventCodeText)
                {
                    EventDescription = message,
                    EventUrl         = RequestContext.CurrentURL
                };

                Service.Resolve <IEventLogService>().LogEvent(logData);
            }
        }
コード例 #8
0
        public void LogError(string message, string sourceText, string eventCodeText, bool logToEventLog)
        {
            string value = FAILED_SIGN + AbstractImportExportSettings.SEPARATOR + "<span class=\"SelectorError\">" + message + "</span>" + content;

            PersistentStorageHelper.SetValue(STORAGE_KEY, value);
            if (logToEventLog)
            {
                var logData = new EventLogData(EventTypeEnum.Error, sourceText, eventCodeText)
                {
                    EventDescription = message,
                    EventUrl         = RequestContext.CurrentURL
                };

                Service.Resolve <IEventLogService>().LogEvent(logData);
            }
        }
コード例 #9
0
ファイル: SeparateDB.aspx.cs プロジェクト: isatriya/kentico10
    /// <summary>
    /// Takes all sites offline.
    /// </summary>
    private void TakeSitesOffline()
    {
        var sites = SiteInfoProvider.GetSites()
                    .WhereNull("SiteIsOffline")
                    .Or()
                    .WhereEquals("SiteIsOffline", 0)
                    .TypedResult;

        var siteIDs = new List <int>(sites.Items.Count);

        foreach (var site in sites)
        {
            site.SiteIsOffline = true;
            SiteInfoProvider.SetSiteInfo(site);
            siteIDs.Add(site.SiteID);
        }
        PersistentStorageHelper.SetValue("SeparateDBSites", siteIDs);
    }
コード例 #10
0
    /// <summary>
    /// Stop tasks.
    /// </summary>
    void btnStopTasks_Click(object sender, EventArgs e)
    {
        // Stop tasks
        PersistentStorageHelper.SetValue("CMSSchedulerTasksEnabled", SettingsKeyInfoProvider.GetBoolValue("CMSSchedulerTasksEnabled"));
        if (SchedulingHelper.EnableScheduler)
        {
            SettingsKeyInfoProvider.SetValue("CMSSchedulerTasksEnabled", false);
        }

        // Restart win service
        WinServiceItem def = WinServiceHelper.GetServiceDefinition(WinServiceHelper.HM_SERVICE_BASENAME);

        if (def != null)
        {
            WinServiceHelper.RestartService(def.GetServiceName());
        }

        // Display stopping progress
        iconHelp.Visible = btnStopTasks.Visible = false;
        DisplayStoppingTasks();
        TasksManuallyStopped = true;
    }