public override SummaryData GetEventSummaryData(PersistentEvent ev) { if (!ShouldHandle(ev)) return null; dynamic data = new ExpandoObject(); data.SessionId = ev.SessionId; if (ev.IsSessionStart()) { data.Value = ev.Value.GetValueOrDefault(); DateTime? endTime = ev.GetSessionEndTime(); if (endTime.HasValue) data.SessionEnd = endTime; } var identity = ev.GetUserIdentity(); if (identity != null) { if (!String.IsNullOrEmpty(identity.Identity)) data.Identity = identity.Identity; if (!String.IsNullOrEmpty(identity.Name)) data.Name = identity.Name; } return new SummaryData { TemplateKey = "event-session-summary", Data = data }; }
public override SummaryData GetEventSummaryData(PersistentEvent ev) { if (!ShouldHandle(ev)) return null; var data = new Dictionary<string, object> { { "SessionId", ev.GetSessionId() }, { "Type", ev.Type } }; AddUserIdentitySummaryData(data, ev.GetUserIdentity()); if (ev.IsSessionStart()) { data.Add("Value", ev.Value.GetValueOrDefault()); DateTime? endTime = ev.GetSessionEndTime(); if (endTime.HasValue) data.Add("SessionEnd", endTime); } return new SummaryData { TemplateKey = "event-session-summary", Data = data }; }