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
- DefaultTextStore.cs
- StylusPointDescription.cs
- FormViewDeleteEventArgs.cs
- ToolstripProfessionalRenderer.cs
- WindowsScroll.cs
- DependencyProperty.cs
- StreamReader.cs
- EndPoint.cs
- StringSource.cs
- _ProxyChain.cs
- XmlAnyAttributeAttribute.cs
- XmlSchemaIdentityConstraint.cs
- StylusPointProperty.cs
- ClientOptions.cs
- CompleteWizardStep.cs
- HostingEnvironment.cs
- Icon.cs
- CompositeControl.cs
- EnterpriseServicesHelper.cs
- OletxCommittableTransaction.cs
- ColorDialog.cs
- WpfPayload.cs
- UnsafeNativeMethodsMilCoreApi.cs
- FacetChecker.cs
- CodeMemberMethod.cs
- LeaseManager.cs
- WebEventTraceProvider.cs
- VideoDrawing.cs
- XmlSchemaComplexContent.cs
- ContainerSelectorActiveEvent.cs
- DbReferenceCollection.cs
- SafeArrayTypeMismatchException.cs
- TextElementEditingBehaviorAttribute.cs
- TreeNodeClickEventArgs.cs
- OutputCacheModule.cs
- LogLogRecordEnumerator.cs
- DiscriminatorMap.cs
- TPLETWProvider.cs
- CodeAttributeArgument.cs
- Assembly.cs
- XslNumber.cs
- FrugalList.cs
- UserPersonalizationStateInfo.cs
- BackgroundWorker.cs
- WebPartDisplayModeCancelEventArgs.cs
- WindowsBrush.cs
- XmlIgnoreAttribute.cs
- WebZone.cs
- ControlTemplate.cs
- RefType.cs
- QueryCacheEntry.cs
- RenderTargetBitmap.cs
- METAHEADER.cs
- MsdtcWrapper.cs
- WSSecureConversationFeb2005.cs
- ListView.cs
- _Semaphore.cs
- ACL.cs
- BasicCellRelation.cs
- safesecurityhelperavalon.cs
- AnnotationComponentChooser.cs
- AssociationType.cs
- ConstantSlot.cs
- ZipPackage.cs
- DbParameterCollectionHelper.cs
- ObjectReaderCompiler.cs
- TypeSystemProvider.cs
- TreeNodeSelectionProcessor.cs
- FrameworkElementAutomationPeer.cs
- TemplateControlBuildProvider.cs
- PeerContact.cs
- DefaultBindingPropertyAttribute.cs
- FrameworkRichTextComposition.cs
- ModuleElement.cs
- InputScope.cs
- MessageSmuggler.cs
- PrivilegedConfigurationManager.cs
- DataListGeneralPage.cs
- SoapAttributes.cs
- HttpModulesSection.cs
- PostBackOptions.cs
- InstanceStore.cs
- BitmapEffectCollection.cs
- ObjectNotFoundException.cs
- xml.cs
- TrackingDataItem.cs
- FileDataSourceCache.cs
- HexParser.cs
- DataTableReader.cs
- TiffBitmapDecoder.cs
- OracleInfoMessageEventArgs.cs
- SizeAnimation.cs
- ConfigurationStrings.cs
- SoapParser.cs
- XmlDataSource.cs
- DataContractSerializer.cs
- ActivityPreviewDesigner.cs
- DiagnosticTrace.cs
- DataSourceControl.cs
- SqlDataSourceView.cs