Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / Binding / BindingUtils.cs / 1305376 / BindingUtils.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Utilities for binding related operations // // //--------------------------------------------------------------------- namespace System.Data.Services.Client { #region Namespaces using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Reflection; using System.Collections; #endregion ///Utilities for binding related operations internal static class BindingUtils { ////// Throw if the entity set name is null or empty /// /// entity set name. /// entity instance for which the entity set name is generated. internal static void ValidateEntitySetName(string entitySetName, object entity) { if (String.IsNullOrEmpty(entitySetName)) { throw new InvalidOperationException(Strings.DataBinding_Util_UnknownEntitySetName(entity.GetType().FullName)); } } ////// Given a collection type, gets it's entity type /// /// Input collection type ///Generic type argument for the collection internal static Type GetCollectionEntityType(Type collectionType) { while (collectionType != null) { if (collectionType.IsGenericType && WebUtil.IsDataServiceCollectionType(collectionType.GetGenericTypeDefinition())) { return collectionType.GetGenericArguments()[0]; } collectionType = collectionType.BaseType; } return null; } ///Verifies the absence of observer for an DataServiceCollection ///Type of DataServiceCollection /// Non-typed collection object /// Collection property of the source object which is being assigned to /// Type of the source object internal static void VerifyObserverNotPresent(object oec, string sourceProperty, Type sourceType) { Debug.Assert(BindingEntityInfo.IsDataServiceCollection(oec.GetType()), "Must be an DataServiceCollection."); DataServiceCollection typedCollection = oec as DataServiceCollection ; if (typedCollection.Observer != null) { throw new InvalidOperationException(Strings.DataBinding_CollectionPropertySetterValueHasObserver(sourceProperty, sourceType)); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PrimitiveXmlSerializers.cs
- BitmapEffectGroup.cs
- IPEndPoint.cs
- ReservationCollection.cs
- ProvideValueServiceProvider.cs
- FamilyMapCollection.cs
- DataTableTypeConverter.cs
- ApplicationFileParser.cs
- ColorConverter.cs
- MultitargetUtil.cs
- SqlProviderManifest.cs
- SQLBinaryStorage.cs
- ThreadAbortException.cs
- TabPage.cs
- CanonicalFontFamilyReference.cs
- TokenCreationException.cs
- QueryContinueDragEvent.cs
- EntityWithChangeTrackerStrategy.cs
- WebProxyScriptElement.cs
- CharacterMetricsDictionary.cs
- ExclusiveCanonicalizationTransform.cs
- Shape.cs
- JournalNavigationScope.cs
- Substitution.cs
- PublishLicense.cs
- CTreeGenerator.cs
- AlphabeticalEnumConverter.cs
- ImageCodecInfo.cs
- FontFamily.cs
- EntryPointNotFoundException.cs
- BufferedStream.cs
- DetailsViewUpdatedEventArgs.cs
- GridViewSortEventArgs.cs
- DeleteMemberBinder.cs
- ResourceKey.cs
- PhonemeEventArgs.cs
- SafeSecurityHandles.cs
- MetaModel.cs
- QilXmlReader.cs
- ToolboxBitmapAttribute.cs
- WebPartMenuStyle.cs
- ToolStripDropDownDesigner.cs
- HtmlEncodedRawTextWriter.cs
- AnnotationResource.cs
- SafePointer.cs
- Expander.cs
- StrongBox.cs
- ExceptionHandlerDesigner.cs
- Registry.cs
- TimeSpanConverter.cs
- PageThemeCodeDomTreeGenerator.cs
- RawAppCommandInputReport.cs
- DataControlReference.cs
- DataRelation.cs
- RegexNode.cs
- ConditionalAttribute.cs
- StringPropertyBuilder.cs
- DeferredRunTextReference.cs
- OrderedDictionary.cs
- PageStatePersister.cs
- ParallelForEach.cs
- ControlType.cs
- BmpBitmapEncoder.cs
- BaseTreeIterator.cs
- TextCompositionEventArgs.cs
- GradientStopCollection.cs
- CounterCreationData.cs
- InputMethodStateChangeEventArgs.cs
- DataGridViewCellEventArgs.cs
- GeneralTransform3DTo2D.cs
- RandomNumberGenerator.cs
- HttpResponseHeader.cs
- ApplicationServiceManager.cs
- TextFindEngine.cs
- ParserStreamGeometryContext.cs
- PartialCachingAttribute.cs
- UndoManager.cs
- Repeater.cs
- IriParsingElement.cs
- RSAPKCS1SignatureDeformatter.cs
- ColorConverter.cs
- AnnotationComponentChooser.cs
- StreamUpgradeBindingElement.cs
- DataServiceQueryContinuation.cs
- InputLanguageManager.cs
- PropertyInfoSet.cs
- TransactionChannelFaultConverter.cs
- SqlHelper.cs
- EpmSourceTree.cs
- CustomWebEventKey.cs
- Perspective.cs
- ComplexBindingPropertiesAttribute.cs
- OleDbReferenceCollection.cs
- DataPointer.cs
- WindowsTreeView.cs
- LayoutEditorPart.cs
- Font.cs
- LogReservationCollection.cs
- PageContent.cs
- DbProviderSpecificTypePropertyAttribute.cs