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
- GridViewRowEventArgs.cs
- SHA384Managed.cs
- ReceiveSecurityHeaderEntry.cs
- SiteMembershipCondition.cs
- VisualBasicSettingsConverter.cs
- RowToParametersTransformer.cs
- ExpressionEditorAttribute.cs
- BitmapMetadataEnumerator.cs
- grammarelement.cs
- ValueOfAction.cs
- CallContext.cs
- PackageRelationship.cs
- VectorCollectionValueSerializer.cs
- AttributeCollection.cs
- EntityViewGenerationAttribute.cs
- SQLDoubleStorage.cs
- OdbcEnvironment.cs
- Grid.cs
- Menu.cs
- contentDescriptor.cs
- BinaryNode.cs
- SemanticAnalyzer.cs
- Expression.cs
- ServiceNameElementCollection.cs
- Identifier.cs
- Int16Converter.cs
- ControlCachePolicy.cs
- Iis7Helper.cs
- DockingAttribute.cs
- ToolBarButtonClickEvent.cs
- ColorTypeConverter.cs
- DbConnectionPool.cs
- APCustomTypeDescriptor.cs
- PageTheme.cs
- Stackframe.cs
- MouseGestureValueSerializer.cs
- ThousandthOfEmRealDoubles.cs
- StackBuilderSink.cs
- Command.cs
- SafeFileMapViewHandle.cs
- ProxyWebPart.cs
- EndpointAddress.cs
- CodeAccessPermission.cs
- GACIdentityPermission.cs
- Debug.cs
- AsyncContentLoadedEventArgs.cs
- FontStretchConverter.cs
- SignedXml.cs
- Activator.cs
- XpsS0ValidatingLoader.cs
- DesignSurfaceManager.cs
- ReverseComparer.cs
- Pen.cs
- SiteMapDataSourceView.cs
- XmlNamedNodeMap.cs
- CompositeFontFamily.cs
- _SslSessionsCache.cs
- QueryContinueDragEventArgs.cs
- XmlComment.cs
- DbModificationCommandTree.cs
- SchemeSettingElement.cs
- TabPage.cs
- TablePatternIdentifiers.cs
- ReliableSession.cs
- SqlOuterApplyReducer.cs
- BatchServiceHost.cs
- CanonicalizationDriver.cs
- XmlTextWriter.cs
- DrawingBrush.cs
- LostFocusEventManager.cs
- TypeBuilder.cs
- MethodRental.cs
- EventProviderWriter.cs
- XDeferredAxisSource.cs
- ArrayList.cs
- WindowsListBox.cs
- SafeWaitHandle.cs
- DBConnectionString.cs
- ProgressPage.cs
- CodeDOMProvider.cs
- SqlFunctionAttribute.cs
- ObjectHandle.cs
- AdPostCacheSubstitution.cs
- XmlAttributeOverrides.cs
- DataGridTemplateColumn.cs
- BaseDataListActionList.cs
- LocalizedNameDescriptionPair.cs
- NavigationExpr.cs
- HtmlToClrEventProxy.cs
- PrimaryKeyTypeConverter.cs
- BaseValidator.cs
- TrackBar.cs
- StringDictionaryWithComparer.cs
- AxisAngleRotation3D.cs
- MemberAssignmentAnalysis.cs
- UidManager.cs
- PreloadedPackages.cs
- ModelItem.cs
- RadioButtonFlatAdapter.cs
- KeyBinding.cs