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
- QueryStringParameter.cs
- DataListCommandEventArgs.cs
- MouseGestureConverter.cs
- RepeaterItemCollection.cs
- ListItemParagraph.cs
- CodeDomDecompiler.cs
- DataGridViewRow.cs
- StreamMarshaler.cs
- SrgsElementList.cs
- ObfuscateAssemblyAttribute.cs
- Not.cs
- Path.cs
- MimeFormReflector.cs
- GeneratedContractType.cs
- ExpressionBinding.cs
- Transform.cs
- TrustManagerMoreInformation.cs
- XsltLibrary.cs
- BamlTreeNode.cs
- ClockController.cs
- StringBuilder.cs
- XappLauncher.cs
- MissingManifestResourceException.cs
- Transform.cs
- SQLInt64.cs
- BinaryParser.cs
- DataControlButton.cs
- PathData.cs
- SupportingTokenParameters.cs
- XmlSchemaObjectTable.cs
- PagesChangedEventArgs.cs
- WebSysDescriptionAttribute.cs
- VirtualDirectoryMappingCollection.cs
- MiniConstructorInfo.cs
- SerializationInfo.cs
- Int16Storage.cs
- ProcessInfo.cs
- EventListenerClientSide.cs
- JsonByteArrayDataContract.cs
- CustomActivityDesigner.cs
- VariantWrapper.cs
- DocumentAutomationPeer.cs
- ADMembershipProvider.cs
- ToolStripDropDownClosingEventArgs.cs
- Point3DAnimationUsingKeyFrames.cs
- CalendarKeyboardHelper.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- IndependentlyAnimatedPropertyMetadata.cs
- SortQuery.cs
- FragmentQueryKB.cs
- TextTreeRootNode.cs
- ReferenceService.cs
- EventProviderWriter.cs
- ArrayList.cs
- RotateTransform.cs
- MemberHolder.cs
- XPathMultyIterator.cs
- ExtendedTransformFactory.cs
- ResourceReferenceExpression.cs
- ContentDisposition.cs
- BCLDebug.cs
- SqlBulkCopyColumnMapping.cs
- ListControlConvertEventArgs.cs
- SoapAttributeOverrides.cs
- BrowserDefinition.cs
- TemplateField.cs
- LinkedList.cs
- XomlCompilerError.cs
- SecurityTokenTypes.cs
- SafeThemeHandle.cs
- InputEventArgs.cs
- NativeMethodsOther.cs
- StorageMappingItemLoader.cs
- MgmtResManager.cs
- CompileXomlTask.cs
- controlskin.cs
- FixedSOMTableRow.cs
- DisplayNameAttribute.cs
- InternalConfigHost.cs
- ServicePoint.cs
- GlyphsSerializer.cs
- AtomServiceDocumentSerializer.cs
- CqlErrorHelper.cs
- OperatingSystem.cs
- SystemSounds.cs
- MemoryFailPoint.cs
- WriterOutput.cs
- Relationship.cs
- StrongNameHelpers.cs
- PropertyEmitterBase.cs
- _AuthenticationState.cs
- ClientBuildManager.cs
- JournalEntryStack.cs
- SystemEvents.cs
- MatrixStack.cs
- Int32RectConverter.cs
- DataGridPageChangedEventArgs.cs
- FixedTextView.cs
- UnitySerializationHolder.cs
- HttpListenerContext.cs