示例#1
0
    /// <summary>
    /// Log activity
    /// </summary>
    /// <param name="ari">Report info</param>
    private void LogActivity(AbuseReportInfo ari)
    {
        var activityContext = AnalyticsContext.ActivityEnvironmentVariables;

        // Backup referrer and current URL from AnalyticsContext
        string originalReferrer = activityContext.CurrentURLReferrer;
        Uri    originalURL      = activityContext.CurrentURL;

        // Set it to the values from AbuseReportInfo so correct ones are used to create Activity
        activityContext.CurrentURLReferrer = "";
        if (ari.ReportURL != null)
        {
            activityContext.CurrentURL = new Uri(ari.ReportURL);
        }

        Activity activity = new ActivityAbuseReport(ari, activityContext);

        activity.Log();

        // Set old values back to AnalyticsContext
        activityContext.CurrentURLReferrer = originalReferrer;
        activityContext.CurrentURL         = originalURL;
    }
    /// <summary>
    /// Log activity
    /// </summary>
    /// <param name="ari">Report info</param>
    private void LogActivity(AbuseReportInfo ari)
    {
        Activity activity = new ActivityAbuseReport(ari, CMSContext.ActivityEnvironmentVariables);

        activity.Log();
    }
    /// <summary>
    /// Log activity
    /// </summary>
    /// <param name="ari">Report info</param>
    private void LogActivity(AbuseReportInfo ari)
    {
        var activityContext = AnalyticsContext.ActivityEnvironmentVariables;

        // Backup referrer and current URL from AnalyticsContext
        string originalReferrer = activityContext.CurrentURLReferrer;
        Uri originalURL = activityContext.CurrentURL;

        // Set it to the values from AbuseReportInfo so correct ones are used to create Activity
        activityContext.CurrentURLReferrer = "";
        if (ari.ReportURL != null)
        {
            activityContext.CurrentURL = new Uri(ari.ReportURL);
        }

        Activity activity = new ActivityAbuseReport(ari, activityContext);
        activity.Log();

        // Set old values back to AnalyticsContext
        activityContext.CurrentURLReferrer = originalReferrer;
        activityContext.CurrentURL = originalURL;
    }
 /// <summary>
 /// Log activity
 /// </summary>
 /// <param name="ari">Report info</param>
 private void LogActivity(AbuseReportInfo ari)
 {
     Activity activity = new ActivityAbuseReport(ari, CMSContext.ActivityEnvironmentVariables);
     activity.Log();
 }