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
- HostedHttpTransportManager.cs
- SystemIPv4InterfaceProperties.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- ZipPackage.cs
- DialogDivider.cs
- DataGridViewDataErrorEventArgs.cs
- Itemizer.cs
- MeshGeometry3D.cs
- DbInsertCommandTree.cs
- MatrixTransform3D.cs
- Help.cs
- ValidationSummary.cs
- WebPartConnectionsCancelEventArgs.cs
- EventListenerClientSide.cs
- PropertyChange.cs
- CompilerTypeWithParams.cs
- AssociatedControlConverter.cs
- _AutoWebProxyScriptWrapper.cs
- AspNetRouteServiceHttpHandler.cs
- FixedSOMPage.cs
- NoneExcludedImageIndexConverter.cs
- MimePart.cs
- ClientOptions.cs
- XmlSiteMapProvider.cs
- ImmutableObjectAttribute.cs
- UnaryNode.cs
- DiscreteKeyFrames.cs
- ActivationServices.cs
- LinqDataSourceStatusEventArgs.cs
- ConfigDefinitionUpdates.cs
- ExceptionRoutedEventArgs.cs
- UnsafeNativeMethods.cs
- DbCommandTree.cs
- IntSecurity.cs
- InputMethodStateTypeInfo.cs
- HtmlInputImage.cs
- ContractTypeNameCollection.cs
- ReflectionTypeLoadException.cs
- Ops.cs
- ParameterToken.cs
- StrokeCollection2.cs
- CryptoProvider.cs
- ScriptModule.cs
- DataServiceRequestException.cs
- PkcsMisc.cs
- FrameworkContentElement.cs
- ThrowHelper.cs
- TextTreeRootTextBlock.cs
- BitmapEffectvisualstate.cs
- SortAction.cs
- InputScope.cs
- WaitForChangedResult.cs
- SignatureToken.cs
- XhtmlBasicControlAdapter.cs
- XmlSchemaValidationException.cs
- Regex.cs
- FileRecordSequence.cs
- StrongName.cs
- GPStream.cs
- Timer.cs
- SetterBaseCollection.cs
- OracleInfoMessageEventArgs.cs
- ExtendedPropertyCollection.cs
- RegexParser.cs
- DES.cs
- SmiConnection.cs
- TextAnchor.cs
- FontFaceLayoutInfo.cs
- Timer.cs
- DiagnosticStrings.cs
- CompensatableTransactionScopeActivity.cs
- ErrorRuntimeConfig.cs
- CodeGenHelper.cs
- XmlAutoDetectWriter.cs
- ProfileService.cs
- ProtectedConfigurationSection.cs
- ToolStripItemGlyph.cs
- BamlBinaryWriter.cs
- WindowsTreeView.cs
- ChtmlTextWriter.cs
- InputReportEventArgs.cs
- XmlSerializationWriter.cs
- DispatcherHookEventArgs.cs
- HTTPRemotingHandler.cs
- CollectionBase.cs
- ReadOnlyObservableCollection.cs
- XamlFigureLengthSerializer.cs
- WebPartMenuStyle.cs
- ManagedWndProcTracker.cs
- GlobalDataBindingHandler.cs
- CodeBinaryOperatorExpression.cs
- CqlLexerHelpers.cs
- IIS7UserPrincipal.cs
- ImageButton.cs
- CustomWebEventKey.cs
- FileLoadException.cs
- TreeView.cs
- ReleaseInstanceMode.cs
- CircleHotSpot.cs
- RelatedImageListAttribute.cs