/// <summary> /// Throws exception if <see cref="IsDisposed"/> is true or <see cref="EnumerationState"/> is not equals <see cref="DataSourceEnumerationState.Enumerable"/>. /// </summary> protected void EnsureEnumerate() { if (IsDisposed) { throw new ObjectDisposedException("The data source has been disposed and can not be enumerated again"); } if (!EnumerationState.HasFlag(DataSourceEnumerationState.Enumerable)) { throw new InvalidOperationException("The data source has been already enumerated"); } }