static Event _paste(Event source, Event dest, TPasteLocation location, ClipboardOperation operation) { if (operation == ClipboardOperation.Cut && source.Engine == dest.Engine) { source.Remove(); switch (location) { case TPasteLocation.After: dest.InsertAfter(source); break; case TPasteLocation.Before: dest.InsertBefore(source); break; case TPasteLocation.Under: dest.InsertUnder(source); break; } return source; } if (operation == ClipboardOperation.Copy && source.Engine == dest.Engine) { Event newEvent = source.Clone(); switch (location) { case TPasteLocation.After: dest.InsertAfter(newEvent); break; case TPasteLocation.Before: dest.InsertBefore(newEvent); break; case TPasteLocation.Under: if (dest.EventType == TEventType.Container) newEvent.ScheduledTime = DateTime.UtcNow; dest.InsertUnder(newEvent); break; } return newEvent; } throw new ArgumentException("Event engines are different"); }