public void StartEvent(RequestData.NewEvent newEvent) { if (m_eventRows.ContainsKey(newEvent.EventId)) { m_eventRows[newEvent.EventId].Cells[(int)DGEventCells.Status].Value = "active"; } }
/********************************************************************************/ private void HandlePayload_StartEventInterval(string payload) { RequestData.NewEvent newEvent = JsonConvert.DeserializeObject <RequestData.NewEvent>(payload); // the event is already active, just need to log this message UCEventLog.LogMessage("start event interval: " + newEvent.EventId + "\n" + payload); }
public void ModifyEvent(RequestData.NewEvent newEvent) { if (m_eventRows.ContainsKey(newEvent.EventId)) { m_eventRows[newEvent.EventId].Cells[(int)DGEventCells.StartTime].Value = Util.FromEpochToLocalTime(newEvent.DtStartTimet); m_eventRows[newEvent.EventId].Cells[(int)DGEventCells.Duration].Value = newEvent.DurationInSeconds; } }
/********************************************************************************/ private void HandlePayload_ModifyEvent(string payload) { RequestData.NewEvent newEvent = JsonConvert.DeserializeObject <RequestData.NewEvent>(payload); UCEventList.ModifyEvent(newEvent); UCEventLog.LogMessage("modify event: " + newEvent.EventId + "\n" + payload); }
public void NewEvent(RequestData.NewEvent newEvent) { if (!m_eventRows.ContainsKey(newEvent.EventId)) { // assume an event can only start if Nova sends a start event message, so // the status here will either be complete because the event start time // plus duration is in the past, or the event will be pending string status = ((Util.FromEpochToLocalTime(newEvent.DtStartTimet).AddSeconds(newEvent.DurationInSeconds) < DateTime.Now) ? "complete" : "pending"); DGEvent.Rows.Add(newEvent.EventId, Util.FromEpochToLocalTime(newEvent.DtStartTimet), newEvent.DurationInSeconds, newEvent.Status, "optIn"); // and track the stored row in our dictionary (the row just added is the last row) m_eventRows[newEvent.EventId] = DGEvent.Rows[DGEvent.Rows.Count - 1]; } else { ModifyEvent(newEvent); } }
public void StartEventInterval(RequestData.NewEvent newEvent) { }