/// <summary> /// If the current recent change item is a log event, returns the corresponding log event item. /// </summary> /// <exception cref="InvalidOperationException"><see cref="Type"/> is not <see cref="RecentChangesType.Log"/>.</exception> /// <returns>The corresponding log event item.</returns> public LogEventItem ToLogEventItem() { if (Type != RecentChangesType.Log) { throw new InvalidOperationException("The Type of the RecentChangeItem should be RecentChangesType.Log to acquire the LogEventItem."); } return(LogEventItem.FromRecentChangeItem(this)); }
/// <summary> /// If the current recent change item is a log event, returns the corresponding log event item. /// </summary> /// <exception cref="InvalidOperationException"><see cref="Type"/> is not <see cref="RecentChangesType.Log"/>.</exception> /// <returns>The corresponding log event item.</returns> public LogEventItem ToLogEventItem() { if (Type != RecentChangesType.Log) { throw new InvalidOperationException(string.Format(Prompts.ExceptionRequireParamValue2, nameof(RecentChangeItem) + "." + nameof(Type), RecentChangesType.Log)); } return(LogEventItem.FromRecentChangeItem(this)); }