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
- SortedSetDebugView.cs
- RegexCode.cs
- ExpressionBuilder.cs
- NativeRightsManagementAPIsStructures.cs
- CompiledQuery.cs
- DataGridColumn.cs
- BamlRecordHelper.cs
- NativeMethods.cs
- SpecialNameAttribute.cs
- XmlHierarchicalEnumerable.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- ComUdtElement.cs
- DocumentPageView.cs
- SystemIPv6InterfaceProperties.cs
- RequiredFieldValidator.cs
- PackageFilter.cs
- _SafeNetHandles.cs
- CopyAttributesAction.cs
- SmtpClient.cs
- CompilerScope.Storage.cs
- PassportIdentity.cs
- Stroke2.cs
- OleDbParameter.cs
- MatrixCamera.cs
- RemotingException.cs
- DropDownButton.cs
- UnsafeNativeMethods.cs
- AdornerPresentationContext.cs
- WebEncodingValidatorAttribute.cs
- Page.cs
- ProxyHwnd.cs
- DiscreteKeyFrames.cs
- InstancePersistenceEvent.cs
- TranslateTransform.cs
- QfeChecker.cs
- documentsequencetextview.cs
- TypeRefElement.cs
- CodeDomSerializer.cs
- HelpEvent.cs
- SqlServer2KCompatibilityAnnotation.cs
- CallSiteBinder.cs
- PackagingUtilities.cs
- ConfigurationStrings.cs
- CssTextWriter.cs
- SelectedPathEditor.cs
- DocComment.cs
- SqlUtil.cs
- ConstraintStruct.cs
- CodeTypeReferenceExpression.cs
- PlatformCulture.cs
- XmlNodeChangedEventArgs.cs
- WorkflowApplicationException.cs
- SafeProcessHandle.cs
- TableItemStyle.cs
- ServicesSection.cs
- XmlLinkedNode.cs
- Misc.cs
- DictionaryCustomTypeDescriptor.cs
- XmlSchemaCollection.cs
- MultiPageTextView.cs
- WindowsEditBoxRange.cs
- HtmlAnchor.cs
- FlowLayout.cs
- WorkingDirectoryEditor.cs
- XmlComplianceUtil.cs
- StateBag.cs
- XmlAnyElementAttribute.cs
- PasswordPropertyTextAttribute.cs
- MimeTypeAttribute.cs
- Function.cs
- DeclarativeCatalogPart.cs
- EventManager.cs
- XPathAncestorQuery.cs
- SqlCommandBuilder.cs
- SingleBodyParameterMessageFormatter.cs
- PEFileReader.cs
- HttpHandlersSection.cs
- xmlfixedPageInfo.cs
- DynamicVirtualDiscoSearcher.cs
- AssemblyInfo.cs
- VBIdentifierTrimConverter.cs
- DataConnectionHelper.cs
- TextDecoration.cs
- FormsAuthenticationConfiguration.cs
- GenericWebPart.cs
- Vector3DAnimationBase.cs
- Animatable.cs
- ObjectQueryProvider.cs
- ScriptServiceAttribute.cs
- ProviderConnectionPoint.cs
- RelationshipFixer.cs
- NotifyParentPropertyAttribute.cs
- OpCopier.cs
- UnsafeMethods.cs
- XmlSchemaAppInfo.cs
- Attributes.cs
- ControlSerializer.cs
- CodeSubDirectory.cs
- ServicePoint.cs
- PropertyInfoSet.cs