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
- InteropAutomationProvider.cs
- metadatamappinghashervisitor.cs
- ToolStripCustomTypeDescriptor.cs
- ButtonBaseDesigner.cs
- BindingCompleteEventArgs.cs
- WsatConfiguration.cs
- SqlTriggerContext.cs
- ToolboxItemFilterAttribute.cs
- TrustLevelCollection.cs
- SafeEventLogReadHandle.cs
- DataGrid.cs
- StatusBarAutomationPeer.cs
- MasterPageCodeDomTreeGenerator.cs
- RestClientProxyHandler.cs
- CommandID.cs
- Vector3DCollection.cs
- PropertyRef.cs
- FrameworkTextComposition.cs
- HttpApplicationStateWrapper.cs
- ServiceDebugBehavior.cs
- SqlReferenceCollection.cs
- ClientBuildManager.cs
- SoapInteropTypes.cs
- ZipIOExtraFieldZip64Element.cs
- TemplateManager.cs
- LinkButton.cs
- WinCategoryAttribute.cs
- ToolboxCategory.cs
- StringHandle.cs
- DataProviderNameConverter.cs
- TransactionState.cs
- ReadOnlyDataSource.cs
- UdpRetransmissionSettings.cs
- ProtectedConfigurationProviderCollection.cs
- Funcletizer.cs
- WeakRefEnumerator.cs
- ListManagerBindingsCollection.cs
- WaitHandleCannotBeOpenedException.cs
- ViewLoader.cs
- WindowVisualStateTracker.cs
- AttributeProviderAttribute.cs
- ContainerUtilities.cs
- RequestFactory.cs
- ListQueryResults.cs
- TabletCollection.cs
- ResolveMatchesMessageCD1.cs
- XmlCharCheckingReader.cs
- FillBehavior.cs
- FontCollection.cs
- Msmq4SubqueuePoisonHandler.cs
- Point4D.cs
- EntityViewGenerationAttribute.cs
- ClientRoleProvider.cs
- MailBnfHelper.cs
- PropertyIDSet.cs
- Vector3DIndependentAnimationStorage.cs
- PlainXmlWriter.cs
- SrgsElementList.cs
- InplaceBitmapMetadataWriter.cs
- ExternalException.cs
- AuthenticationModuleElementCollection.cs
- ExternalDataExchangeService.cs
- StateElementCollection.cs
- ListViewTableCell.cs
- ManagementObjectSearcher.cs
- HierarchicalDataSourceDesigner.cs
- ToolStripDropDownItem.cs
- DownloadProgressEventArgs.cs
- CompositeActivityTypeDescriptor.cs
- BitmapCodecInfoInternal.cs
- BamlLocalizableResource.cs
- GenericPrincipal.cs
- SymDocumentType.cs
- NativeMethods.cs
- SafeUserTokenHandle.cs
- Pens.cs
- ToolStripPanelRow.cs
- Icon.cs
- RewritingProcessor.cs
- PolicyException.cs
- InertiaExpansionBehavior.cs
- FSWPathEditor.cs
- BaseHashHelper.cs
- ServiceModelConfigurationSection.cs
- ByteFacetDescriptionElement.cs
- StatusBarItem.cs
- SuppressIldasmAttribute.cs
- AppearanceEditorPart.cs
- WinEventHandler.cs
- WindowsListViewGroupSubsetLink.cs
- BufferAllocator.cs
- BrushValueSerializer.cs
- SystemIcons.cs
- SudsParser.cs
- TextBoxView.cs
- ArgumentValue.cs
- BitmapData.cs
- AutomationPropertyInfo.cs
- DefaultTraceListener.cs
- ReliabilityContractAttribute.cs