public static HourBasedCallEvent Create(CallEventType eventType, CallHistory call)
 {
     return(new HourBasedCallEvent
     {
         EventTime = eventType == CallEventType.Start ? call.Started : call.Ended,
         EventType = eventType,
     });
 }
Exemple #2
0
        public static LocationCallEvent Create(CallEventType eventType, CallHistory call, Func <CallHistory, Tuple <Guid, string> > locationSelector)
        {
            var location = locationSelector(call);

            return(new LocationCallEvent
            {
                EventTime = eventType == CallEventType.Start ? call.Started : call.Ended,
                EventType = eventType,
                EndTime = call.Ended,
                LocationId = location.Item1,
                LocationName = location.Item2,
                StartTime = call.Started
            });
        }