Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / Common.cs / 1305376 / Common.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Common defintions and functions for the server and client lib // //--------------------------------------------------------------------- #if ASTORIA_CLIENT namespace System.Data.Services.Client #else namespace System.Data.Services #endif { using System.Linq; using System.Diagnostics; using System.Globalization; using System.IO; using System.Text; using System.Xml; ////// Common defintions and functions for the server and client lib /// internal static class CommonUtil { ////// List of types unsupported by the client /// private static readonly Type[] unsupportedTypes = new Type[] { #if !ASTORIA_LIGHT // System.Dynamic & tuples not available (as of SL 2.0) typeof(System.Dynamic.IDynamicMetaObjectProvider), typeof(System.Tuple<>), // 1-Tuple typeof(System.Tuple<,>), // 2-Tuple typeof(System.Tuple<,,>), // 3-Tuple typeof(System.Tuple<,,,>), // 4-Tuple typeof(System.Tuple<,,,,>), // 5-Tuple typeof(System.Tuple<,,,,,>), // 6-Tuple typeof(System.Tuple<,,,,,,>), // 7-Tuple typeof(System.Tuple<,,,,,,,>) // 8-Tuple #endif }; ////// Test whether a type is unsupported by the client lib /// /// The type to test ///Returns true if the type is not supported internal static bool IsUnsupportedType(Type type) { if (type.IsGenericType) { type = type.GetGenericTypeDefinition(); } if (unsupportedTypes.Any(t => t.IsAssignableFrom(type))) { return true; } Debug.Assert(!type.FullName.StartsWith("System.Tuple", StringComparison.Ordinal), "System.Tuple is not blocked by unsupported type check"); return false; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // //// Common defintions and functions for the server and client lib // //--------------------------------------------------------------------- #if ASTORIA_CLIENT namespace System.Data.Services.Client #else namespace System.Data.Services #endif { using System.Linq; using System.Diagnostics; using System.Globalization; using System.IO; using System.Text; using System.Xml; ////// Common defintions and functions for the server and client lib /// internal static class CommonUtil { ////// List of types unsupported by the client /// private static readonly Type[] unsupportedTypes = new Type[] { #if !ASTORIA_LIGHT // System.Dynamic & tuples not available (as of SL 2.0) typeof(System.Dynamic.IDynamicMetaObjectProvider), typeof(System.Tuple<>), // 1-Tuple typeof(System.Tuple<,>), // 2-Tuple typeof(System.Tuple<,,>), // 3-Tuple typeof(System.Tuple<,,,>), // 4-Tuple typeof(System.Tuple<,,,,>), // 5-Tuple typeof(System.Tuple<,,,,,>), // 6-Tuple typeof(System.Tuple<,,,,,,>), // 7-Tuple typeof(System.Tuple<,,,,,,,>) // 8-Tuple #endif }; ////// Test whether a type is unsupported by the client lib /// /// The type to test ///Returns true if the type is not supported internal static bool IsUnsupportedType(Type type) { if (type.IsGenericType) { type = type.GetGenericTypeDefinition(); } if (unsupportedTypes.Any(t => t.IsAssignableFrom(type))) { return true; } Debug.Assert(!type.FullName.StartsWith("System.Tuple", StringComparison.Ordinal), "System.Tuple is not blocked by unsupported type check"); return false; } } } // 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
- JobCollate.cs
- oledbmetadatacollectionnames.cs
- SocketException.cs
- cache.cs
- BinaryConverter.cs
- XpsDigitalSignature.cs
- Dictionary.cs
- CultureSpecificStringDictionary.cs
- PointCollectionConverter.cs
- RequestSecurityTokenSerializer.cs
- Page.cs
- SymbolMethod.cs
- TypedDatasetGenerator.cs
- MD5.cs
- SelectionUIService.cs
- _AutoWebProxyScriptWrapper.cs
- DocumentXPathNavigator.cs
- StructureChangedEventArgs.cs
- TrustLevel.cs
- CodeNamespaceImportCollection.cs
- ControlAdapter.cs
- DebuggerAttributes.cs
- Attributes.cs
- CharAnimationBase.cs
- WinFormsSecurity.cs
- OrderedDictionaryStateHelper.cs
- SchemaTableOptionalColumn.cs
- DescendentsWalkerBase.cs
- FormattedTextSymbols.cs
- WebOperationContext.cs
- Label.cs
- WsatExtendedInformation.cs
- __Filters.cs
- ImageResources.Designer.cs
- DataServiceRequestException.cs
- BinaryObjectReader.cs
- HandleRef.cs
- ContextMenu.cs
- RtfFormatStack.cs
- CodeTypeDeclarationCollection.cs
- ObjectDataSourceChooseMethodsPanel.cs
- WebDisplayNameAttribute.cs
- GenerateTemporaryTargetAssembly.cs
- LineServicesRun.cs
- ServiceEndpointElementCollection.cs
- HealthMonitoringSectionHelper.cs
- versioninfo.cs
- PreviewPrintController.cs
- ReflectionUtil.cs
- PageThemeBuildProvider.cs
- IDictionary.cs
- CodeArrayIndexerExpression.cs
- DynamicDataRoute.cs
- EntityModelSchemaGenerator.cs
- shaperfactoryquerycachekey.cs
- Math.cs
- AlphabetConverter.cs
- CollectionViewProxy.cs
- _Rfc2616CacheValidators.cs
- SevenBitStream.cs
- BindingWorker.cs
- NavigationPropertyEmitter.cs
- SchemaConstraints.cs
- TypeDescriptionProvider.cs
- StopStoryboard.cs
- COM2ExtendedUITypeEditor.cs
- SecUtil.cs
- SwitchLevelAttribute.cs
- TreeNodeStyle.cs
- InternalUserCancelledException.cs
- XmlUnspecifiedAttribute.cs
- SerializationEventsCache.cs
- IndentedWriter.cs
- SupportsEventValidationAttribute.cs
- PackageFilter.cs
- SoapFormatterSinks.cs
- SQLBinary.cs
- Expressions.cs
- HtmlTable.cs
- SQLDecimalStorage.cs
- DesignerUtility.cs
- CalendarBlackoutDatesCollection.cs
- ResourceContainer.cs
- Constants.cs
- webeventbuffer.cs
- WindowsStartMenu.cs
- OleDbDataAdapter.cs
- AddValidationError.cs
- SafeEventHandle.cs
- VisualProxy.cs
- TagPrefixInfo.cs
- Input.cs
- AspNetHostingPermission.cs
- SafeEventHandle.cs
- WebPartVerbCollection.cs
- FullTrustAssembly.cs
- VectorCollectionConverter.cs
- DataGridLinkButton.cs
- ConnectionPointCookie.cs
- pingexception.cs