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
- HandoffBehavior.cs
- TreeView.cs
- webproxy.cs
- EmitterCache.cs
- FileDialog.cs
- SchemaImporter.cs
- TableAutomationPeer.cs
- DataServiceQueryProvider.cs
- InteropExecutor.cs
- Comparer.cs
- OleDbDataReader.cs
- HtmlAnchor.cs
- SudsParser.cs
- EditingCommands.cs
- SelectingProviderEventArgs.cs
- Util.cs
- ApplicationCommands.cs
- MenuItemAutomationPeer.cs
- CancellationState.cs
- WindowsGraphics.cs
- Update.cs
- Stack.cs
- ReflectPropertyDescriptor.cs
- SettingsPropertyValueCollection.cs
- HierarchicalDataBoundControl.cs
- RuleSetCollection.cs
- ToolStripDropDownItem.cs
- DataObject.cs
- _Win32.cs
- WorkBatch.cs
- ListDictionary.cs
- HtmlWindow.cs
- CustomValidator.cs
- X509CertificateTrustedIssuerElementCollection.cs
- XmlSchemaAll.cs
- MetadataItemCollectionFactory.cs
- ImportCatalogPart.cs
- EntityDataSourceQueryBuilder.cs
- Process.cs
- TextRangeProviderWrapper.cs
- Stack.cs
- NavigationHelper.cs
- SafeThemeHandle.cs
- HTTPNotFoundHandler.cs
- PointCollectionConverter.cs
- TreeNodeCollection.cs
- safex509handles.cs
- TreeNodeBindingCollection.cs
- WinCategoryAttribute.cs
- URLString.cs
- SettingsContext.cs
- ApplicationFileCodeDomTreeGenerator.cs
- _SingleItemRequestCache.cs
- SByteStorage.cs
- TableLayoutPanel.cs
- EntityTypeEmitter.cs
- ClosableStream.cs
- HttpConfigurationContext.cs
- RuntimeConfig.cs
- FixedSOMTextRun.cs
- NullableLongSumAggregationOperator.cs
- DynamicValidatorEventArgs.cs
- RegexCompiler.cs
- ProviderUtil.cs
- CodeSubDirectory.cs
- TransformGroup.cs
- ImportCatalogPart.cs
- ConstrainedGroup.cs
- BinaryMethodMessage.cs
- XXXOnTypeBuilderInstantiation.cs
- RSAPKCS1KeyExchangeFormatter.cs
- DataGridCellClipboardEventArgs.cs
- DatePickerDateValidationErrorEventArgs.cs
- COM2ExtendedBrowsingHandler.cs
- BindingContext.cs
- TypeTypeConverter.cs
- AssemblyAttributes.cs
- BamlLocalizer.cs
- InputLangChangeEvent.cs
- ParallelDesigner.cs
- Command.cs
- EncodingNLS.cs
- GridViewPageEventArgs.cs
- ActionMessageFilterTable.cs
- ScrollPatternIdentifiers.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- PropertyEmitter.cs
- WhitespaceReader.cs
- ModelPropertyDescriptor.cs
- ProtectedConfiguration.cs
- _AuthenticationState.cs
- PerformanceCountersElement.cs
- XmlQueryCardinality.cs
- RoleGroupCollection.cs
- SvcMapFileSerializer.cs
- PreservationFileReader.cs
- BlockingCollection.cs
- WindowsScrollBarBits.cs
- RegexTree.cs
- OleCmdHelper.cs