예제 #1
0
        public IEnumerable <HistoryEvent> TimerCancelledGraph(Identity timerId, TimeSpan startToFireTimeout, bool isARescheduleTimer = false)
        {
            var historyEvents = new List <HistoryEvent>();
            var eventIds      = EventIds.TimerCancelledIds(ref _currentEventId);

            historyEvents.Add(new HistoryEvent()
            {
                EventType = EventType.TimerCanceled,
                EventId   = eventIds.EventId(EventIds.Cancelled),
                TimerCanceledEventAttributes = new TimerCanceledEventAttributes()
                {
                    StartedEventId = eventIds.EventId(EventIds.Started),
                    TimerId        = timerId.Id,
                },
            });

            historyEvents.Add(new HistoryEvent()
            {
                EventType = EventType.TimerStarted,
                EventId   = eventIds.EventId(EventIds.Started),
                TimerStartedEventAttributes = new TimerStartedEventAttributes()
                {
                    TimerId            = timerId.Id,
                    StartToFireTimeout = ((long)startToFireTimeout.TotalSeconds).ToString(),
                    Control            = (new TimerScheduleData()
                    {
                        TimerName = timerId.Name, IsARescheduleTimer = isARescheduleTimer
                    }).ToJson()
                }
            });

            return(historyEvents);
        }