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
- Version.cs
- OptimalTextSource.cs
- FloaterBaseParagraph.cs
- XmlDataSourceView.cs
- Hyperlink.cs
- HtmlEmptyTagControlBuilder.cs
- WsatServiceAddress.cs
- FontResourceCache.cs
- EventItfInfo.cs
- Verify.cs
- TemplateBindingExpression.cs
- hresults.cs
- RadioButtonPopupAdapter.cs
- SocketException.cs
- CellLabel.cs
- Blend.cs
- CheckBoxPopupAdapter.cs
- CultureInfo.cs
- XNodeNavigator.cs
- DataSourceSelectArguments.cs
- ManagedWndProcTracker.cs
- BamlLocalizer.cs
- HttpRequestCacheValidator.cs
- AsyncDataRequest.cs
- FileVersion.cs
- CustomSignedXml.cs
- MessagePropertyFilter.cs
- AliasExpr.cs
- ConfigurationSectionGroup.cs
- AssemblyAttributesGoHere.cs
- KeyNotFoundException.cs
- ApplicationHost.cs
- OracleDataReader.cs
- ASCIIEncoding.cs
- SmtpDigestAuthenticationModule.cs
- TdsParserSessionPool.cs
- DefaultEventAttribute.cs
- XamlFigureLengthSerializer.cs
- CompensationHandlingFilter.cs
- X500Name.cs
- MimeImporter.cs
- NetworkStream.cs
- IssuedSecurityTokenParameters.cs
- FileUpload.cs
- IntSecurity.cs
- Point3DConverter.cs
- RowsCopiedEventArgs.cs
- CompensatableTransactionScopeActivityDesigner.cs
- DynamicValueConverter.cs
- XamlFigureLengthSerializer.cs
- HasCopySemanticsAttribute.cs
- AsyncInvokeContext.cs
- Base64Encoder.cs
- ReservationCollection.cs
- PropertyMap.cs
- SingleAnimationUsingKeyFrames.cs
- TypedElement.cs
- UriTemplateVariableQueryValue.cs
- SerializationHelper.cs
- SoapReflector.cs
- PersonalizationStateQuery.cs
- LinkConverter.cs
- DataBoundControl.cs
- TabControlDesigner.cs
- ObjectListGeneralPage.cs
- ScopelessEnumAttribute.cs
- PlaceHolder.cs
- MethodBuilderInstantiation.cs
- errorpatternmatcher.cs
- BatchStream.cs
- _NtlmClient.cs
- shaperfactoryquerycachekey.cs
- SiteMapDataSource.cs
- ArrayConverter.cs
- RotateTransform.cs
- ReferenceTypeElement.cs
- CachedFontFace.cs
- NameValuePair.cs
- CorrelationScope.cs
- arabicshape.cs
- LassoSelectionBehavior.cs
- SignedInfo.cs
- IIS7WorkerRequest.cs
- WorkflowIdleElement.cs
- PostBackOptions.cs
- __TransparentProxy.cs
- SchemaImporter.cs
- ThreadExceptionEvent.cs
- EntityParameter.cs
- OutKeywords.cs
- PackageRelationshipCollection.cs
- CodeAttributeDeclarationCollection.cs
- CollectionBase.cs
- WebPartCatalogAddVerb.cs
- TextParagraphView.cs
- CodeIndexerExpression.cs
- DecimalConverter.cs
- MemberInfoSerializationHolder.cs
- DataBindingCollection.cs
- NavigatorInput.cs