Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / UI / WebControls / LinqDataSourceHelper.cs / 1305376 / LinqDataSourceHelper.cs
namespace System.Web.UI.WebControls { using System.Collections; using System.Collections.Generic; internal class LinqDataSourceHelper { public static bool EnumerableContentEquals(IEnumerable enumerableA, IEnumerable enumerableB) { IEnumerator enumeratorA = enumerableA.GetEnumerator(); IEnumerator enumeratorB = enumerableB.GetEnumerator(); while (enumeratorA.MoveNext()) { if (!enumeratorB.MoveNext()) return false; object itemA = enumeratorA.Current; object itemB = enumeratorB.Current; if (itemA == null) { if (itemB != null) return false; } else if (!itemA.Equals(itemB)) return false; } if (enumeratorB.MoveNext()) return false; return true; } public static Type FindGenericEnumerableType(Type type) { // Logic taken from Queryable.AsQueryable which accounts for Array types which are not // generic but implement the generic IEnumerable interface. while ((type != null) && (type != typeof(object)) && (type != typeof(string))) { if (type.IsGenericType && (type.GetGenericTypeDefinition() == typeof(IEnumerable<>))) { return type; } foreach (Type interfaceType in type.GetInterfaces()) { Type genericInterface = FindGenericEnumerableType(interfaceType); if (genericInterface != null) { return genericInterface; } } type = type.BaseType; } return null; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SqlConnectionPoolProviderInfo.cs
- Attributes.cs
- OdbcStatementHandle.cs
- DataServiceConfiguration.cs
- HttpCachePolicy.cs
- DebugHandleTracker.cs
- PriorityQueue.cs
- ContainerVisual.cs
- ValueTable.cs
- LoadWorkflowByKeyAsyncResult.cs
- EntitySetBase.cs
- CustomBinding.cs
- ToolStripOverflowButton.cs
- CodeExpressionRuleDeclaration.cs
- AppModelKnownContentFactory.cs
- SessionStateItemCollection.cs
- TableRowGroup.cs
- ListParaClient.cs
- SelectedDatesCollection.cs
- ExtendedPropertyCollection.cs
- CompilerHelpers.cs
- SerializerWriterEventHandlers.cs
- Visual3D.cs
- RegistryConfigurationProvider.cs
- SqlNodeAnnotation.cs
- UndirectedGraph.cs
- httpserverutility.cs
- ControlLocalizer.cs
- ModelUIElement3D.cs
- StringFreezingAttribute.cs
- BrowserTree.cs
- IsolatedStorageFileStream.cs
- XmlQualifiedName.cs
- COM2ExtendedTypeConverter.cs
- TypeUsage.cs
- RepeaterDesigner.cs
- TypedDataSourceCodeGenerator.cs
- SelectionItemProviderWrapper.cs
- VectorCollection.cs
- GiveFeedbackEventArgs.cs
- Filter.cs
- ThrowOnMultipleAssignment.cs
- KoreanCalendar.cs
- EditorPartChrome.cs
- UIElement3D.cs
- PlanCompiler.cs
- WindowsToolbar.cs
- ClipboardProcessor.cs
- RewritingValidator.cs
- RawStylusInput.cs
- InternalCache.cs
- MetadataUtilsSmi.cs
- Int16.cs
- PatternMatcher.cs
- SQLSingle.cs
- DataGridViewComboBoxColumn.cs
- HelpExampleGenerator.cs
- PathGeometry.cs
- StateFinalizationDesigner.cs
- VectorAnimationBase.cs
- PerformanceCounterLib.cs
- CreationContext.cs
- QueuePathEditor.cs
- HttpMethodConstraint.cs
- WindowsListViewItemCheckBox.cs
- KnowledgeBase.cs
- WebHttpDispatchOperationSelectorData.cs
- Timer.cs
- ContentAlignmentEditor.cs
- AbandonedMutexException.cs
- ProgressPage.cs
- WindowShowOrOpenTracker.cs
- DeclaredTypeValidator.cs
- FloaterBaseParagraph.cs
- LiteralSubsegment.cs
- ServiceNotStartedException.cs
- ToolStripDropDownClosedEventArgs.cs
- DPTypeDescriptorContext.cs
- CreateUserWizard.cs
- InvalidStoreProtectionKeyException.cs
- ApplicationServiceManager.cs
- Graph.cs
- VisualBrush.cs
- WindowsListBox.cs
- ZipIOBlockManager.cs
- OletxResourceManager.cs
- KnownTypesHelper.cs
- MimeTypePropertyAttribute.cs
- PeerTransportListenAddressValidator.cs
- DuplicateDetector.cs
- HelloMessage11.cs
- WebResponse.cs
- IConvertible.cs
- BindingNavigator.cs
- FontEmbeddingManager.cs
- datacache.cs
- SchemaTableOptionalColumn.cs
- PathFigure.cs
- UserControl.cs
- XmlSerializerSection.cs