Code:
/ DotNET / DotNET / 8.0 / untmp / Orcas / RTM / ndp / fx / src / xsp / System / Web / Extensions / ui / webcontrols / LinqDataSourceHelper.cs / 1 / 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
- CodeTypeParameterCollection.cs
- Win32.cs
- SetState.cs
- _NetRes.cs
- XPathAncestorIterator.cs
- PermissionRequestEvidence.cs
- Comparer.cs
- FormsAuthentication.cs
- CacheChildrenQuery.cs
- WebPartManager.cs
- List.cs
- SqlTypeConverter.cs
- WebPartConnectionsCancelVerb.cs
- NonParentingControl.cs
- SqlHelper.cs
- KeyInterop.cs
- RegexNode.cs
- SequenceQuery.cs
- UnsafeNativeMethods.cs
- BuildProviderAppliesToAttribute.cs
- KeyConverter.cs
- DSACryptoServiceProvider.cs
- AuthorizationSection.cs
- FactoryRecord.cs
- AvTraceDetails.cs
- Int32CollectionConverter.cs
- PointCollectionValueSerializer.cs
- AuthorizationRule.cs
- Tokenizer.cs
- ComplexTypeEmitter.cs
- EventSetter.cs
- LinkedResourceCollection.cs
- ProcessHost.cs
- Link.cs
- BaseTypeViewSchema.cs
- PreviewKeyDownEventArgs.cs
- WebResponse.cs
- ScriptManager.cs
- TargetException.cs
- GcHandle.cs
- DataGrid.cs
- CalendarButtonAutomationPeer.cs
- DirectoryNotFoundException.cs
- CurrencyWrapper.cs
- ReflectionUtil.cs
- EntityDesignerDataSourceView.cs
- smtppermission.cs
- ExceptionRoutedEventArgs.cs
- IpcChannel.cs
- ColorConvertedBitmapExtension.cs
- ErrorsHelper.cs
- FormCollection.cs
- HtmlInputPassword.cs
- ToggleProviderWrapper.cs
- SelectionProcessor.cs
- Span.cs
- ItemCheckedEvent.cs
- ElementProxy.cs
- ThumbButtonInfoCollection.cs
- FormsAuthentication.cs
- CodeMemberEvent.cs
- RepeatInfo.cs
- SoundPlayerAction.cs
- DictionaryEditChange.cs
- DtrList.cs
- CompilerError.cs
- MobileControlsSectionHandler.cs
- StringStorage.cs
- StaticExtension.cs
- DataGridViewColumnConverter.cs
- GridViewRowPresenterBase.cs
- AlternateView.cs
- SqlDataSourceQuery.cs
- WebServiceData.cs
- DispatcherFrame.cs
- ImageButton.cs
- ImageFormatConverter.cs
- HttpStreamFormatter.cs
- NativeMethods.cs
- StorageMappingFragment.cs
- CodeAttributeDeclarationCollection.cs
- ConsoleKeyInfo.cs
- BroadcastEventHelper.cs
- AssociationSet.cs
- versioninfo.cs
- SectionUpdates.cs
- ImmutableObjectAttribute.cs
- MarkupCompilePass1.cs
- XmlEncoding.cs
- ChangeTracker.cs
- ScrollProperties.cs
- DataRow.cs
- KeyPressEvent.cs
- TimeSpan.cs
- Triplet.cs
- FixUpCollection.cs
- HttpResponse.cs
- SrgsDocument.cs
- QueryExtender.cs
- XmlIncludeAttribute.cs