private BaseEvent SaveEventHelper(uint eventId, Name eventName, ulong timestamp) { AssertEventNameValidity(eventName); if (eventName.HasSelf() && !eventName.ToString().Contains("Property-Change")) { throw new Exception("Cannot record an event name containing \"Self\" keywords"); } BaseEvent eventRecord; if (ActionEvent.IsActionEvent(eventName)) { eventRecord = new ActionEvent(eventId, eventName, timestamp); } else if (PropertyChangeEvent.IsPropertyChangeEvent(eventName)) { eventRecord = new PropertyChangeEvent(eventId, eventName, timestamp); } else { throw new Exception("Unknown Event Type"); } AddRecord(eventRecord); return(eventRecord); }