private Object[][] Convert(EventBean[] events) { if ((events == null) || (events.Length == 0)) { return(null); } Object[][] result = new Object[events.Length][]; int length = 0; for (int i = 0; i < result.Length; i++) { if (events[i] is NaturalEventBean) { NaturalEventBean natural = (NaturalEventBean)events[i]; result[length] = natural.Natural; length++; } } if (length == 0) { return(null); } if (length != events.Length) { Object[][] reduced = new Object[length][]; Array.Copy(result, 0, reduced, 0, length); result = reduced; } return(result); }
private IDictionary <string, object> Convert(NaturalEventBean natural) { var map = new Dictionary <String, Object>(); var columns = natural.Natural; for (int i = 0; i < columns.Length; i++) { map.Put(_columnNames[i], columns[i]); } return(map); }
/// <summary>Indicate an modified event and its previous version. </summary> /// <param name="newEvent">modified event</param> /// <param name="oldEvent">previous version event</param> public void Indicate( EventBean newEvent, EventBean oldEvent) { try { if (StatementResultService.IsMakeNatural) { var natural = new NaturalEventBean(_eventType, new[] { newEvent.Underlying }, newEvent); var naturalOld = new NaturalEventBean(_eventType, new[] { oldEvent.Underlying }, oldEvent); child.Update(new[] { natural }, new[] { naturalOld }); } else { child.Update(new[] { newEvent }, new[] { oldEvent }); } } catch (Exception ex) { Log.Error("Unexpected error updating child view: " + ex.Message); } }