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
- ExceptionHelpers.cs
- CodeSubDirectoriesCollection.cs
- SqlMethods.cs
- ToolboxItemCollection.cs
- iisPickupDirectory.cs
- LocatorPart.cs
- DescendentsWalkerBase.cs
- FileVersionInfo.cs
- safex509handles.cs
- Panel.cs
- ArraySegment.cs
- DateTimeFormat.cs
- ToolBar.cs
- RegisteredExpandoAttribute.cs
- RectKeyFrameCollection.cs
- AssociationType.cs
- ScriptIgnoreAttribute.cs
- GroupDescription.cs
- controlskin.cs
- GuidConverter.cs
- GroupBox.cs
- TreeViewHitTestInfo.cs
- BehaviorEditorPart.cs
- OperatorExpressions.cs
- SamlAction.cs
- PackageRelationshipCollection.cs
- Int64AnimationUsingKeyFrames.cs
- SizeIndependentAnimationStorage.cs
- StateItem.cs
- ActivationArguments.cs
- RelatedPropertyManager.cs
- InfoCardRequestException.cs
- ToolStripArrowRenderEventArgs.cs
- DataBoundLiteralControl.cs
- TextStore.cs
- XNodeNavigator.cs
- BindingExpressionBase.cs
- InsufficientExecutionStackException.cs
- ContentDisposition.cs
- WebFormsRootDesigner.cs
- SkewTransform.cs
- DocumentViewerBase.cs
- OracleParameterCollection.cs
- StyleSheetDesigner.cs
- ToolboxItemAttribute.cs
- TransformerConfigurationWizardBase.cs
- SQLMoney.cs
- ListItem.cs
- X509CertificateChain.cs
- AuthenticatingEventArgs.cs
- ClipboardProcessor.cs
- DataControlImageButton.cs
- BmpBitmapDecoder.cs
- DataGridState.cs
- ExpandedProjectionNode.cs
- SizeKeyFrameCollection.cs
- DependencyPropertyChangedEventArgs.cs
- RequestNavigateEventArgs.cs
- RawUIStateInputReport.cs
- ListViewDataItem.cs
- DateTimeValueSerializer.cs
- NonDualMessageSecurityOverHttpElement.cs
- EventLogEntry.cs
- ButtonAutomationPeer.cs
- FormatterConverter.cs
- SetStoryboardSpeedRatio.cs
- DataSourceViewSchemaConverter.cs
- XmlQueryType.cs
- httpserverutility.cs
- ProcessRequestArgs.cs
- DataGridViewCellFormattingEventArgs.cs
- GenericRootAutomationPeer.cs
- DataMemberAttribute.cs
- XPathItem.cs
- InstancePersistenceException.cs
- MapPathBasedVirtualPathProvider.cs
- NullableDecimalMinMaxAggregationOperator.cs
- ObjectStateFormatter.cs
- TreeIterators.cs
- EventManager.cs
- RemoveStoryboard.cs
- DbReferenceCollection.cs
- XmlSchemaComplexType.cs
- QilReference.cs
- EntitySqlQueryCacheKey.cs
- BoundColumn.cs
- SystemWebSectionGroup.cs
- SecurityException.cs
- DBDataPermissionAttribute.cs
- LayoutTableCell.cs
- TextParagraph.cs
- GeometryGroup.cs
- EntityDataSourceChangingEventArgs.cs
- TdsEnums.cs
- UrlPath.cs
- SqlDataSourceView.cs
- ParallelEnumerableWrapper.cs
- CultureInfoConverter.cs
- DescendantBaseQuery.cs
- ToolboxCategoryItems.cs