static void PrintEvents(CalendarEvent[] events) { foreach (CalendarEvent item in events) { Console.WriteLine(item.Title + ": " + item.StartTime); } }
static CalendarEvent[] CombineEvents(CalendarEvent[] event1, CalendarEvent[] event2) { CalendarEvent[] combinedEvents = new CalendarEvent[event1.Length + event2.Length]; event1.CopyTo(combinedEvents, 0); event2.CopyTo(combinedEvents, event1.Length); return combinedEvents; }
static CalendarEvent[] RemoveFirstEvent(CalendarEvent[] events) { CalendarEvent[] croppedEvents = new CalendarEvent[events.Length - 1]; Array.Copy( events, 1, croppedEvents, 0, events.Length - 1 ); return croppedEvents; }