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
- ComPlusDiagnosticTraceSchemas.cs
- ConfigurationStrings.cs
- CookieParameter.cs
- RelatedView.cs
- ListBindableAttribute.cs
- ArrayTypeMismatchException.cs
- Int64AnimationUsingKeyFrames.cs
- ServiceObjectContainer.cs
- SQLBoolean.cs
- UserControlBuildProvider.cs
- ListViewItem.cs
- XComponentModel.cs
- FunctionMappingTranslator.cs
- SymbolTable.cs
- NavigationWindow.cs
- ByteStorage.cs
- _TransmitFileOverlappedAsyncResult.cs
- SQLBytesStorage.cs
- Rotation3DKeyFrameCollection.cs
- HttpConfigurationSystem.cs
- SharedUtils.cs
- SRDisplayNameAttribute.cs
- DeobfuscatingStream.cs
- ScriptControlDescriptor.cs
- PropertyContainer.cs
- RemotingException.cs
- EndpointDesigner.cs
- TypefaceMetricsCache.cs
- VerificationAttribute.cs
- ServerValidateEventArgs.cs
- MetadataArtifactLoaderCompositeFile.cs
- DocumentApplicationJournalEntry.cs
- ObjectView.cs
- SerializableAttribute.cs
- NamespaceInfo.cs
- ConfigXmlText.cs
- ScopedKnownTypes.cs
- OrderByBuilder.cs
- SchemaImporterExtensionElementCollection.cs
- StreamAsIStream.cs
- regiisutil.cs
- ListParagraph.cs
- HttpRequestBase.cs
- BlurBitmapEffect.cs
- PrinterSettings.cs
- MappingItemCollection.cs
- EDesignUtil.cs
- _AutoWebProxyScriptWrapper.cs
- SqlDependencyUtils.cs
- RangeValidator.cs
- DateBoldEvent.cs
- DataListDesigner.cs
- DesignerFrame.cs
- DataGridViewTextBoxEditingControl.cs
- TextEditorDragDrop.cs
- ActivityDesignerResources.cs
- WebPartConnectionCollection.cs
- XmlSchemaComplexContentExtension.cs
- LogSwitch.cs
- ConstraintStruct.cs
- ZipPackage.cs
- CodeAttributeArgument.cs
- ConfigurationValidatorBase.cs
- InstalledFontCollection.cs
- Speller.cs
- WebDisplayNameAttribute.cs
- NaturalLanguageHyphenator.cs
- MetadataArtifactLoaderResource.cs
- MimeMultiPart.cs
- DbConnectionFactory.cs
- Transform3DGroup.cs
- RepeatBehaviorConverter.cs
- SimpleBitVector32.cs
- OutputCacheProfileCollection.cs
- XmlDataSource.cs
- TextElementCollection.cs
- XmlnsCompatibleWithAttribute.cs
- ObjectNavigationPropertyMapping.cs
- RubberbandSelector.cs
- COM2PictureConverter.cs
- PermissionSetEnumerator.cs
- CodeCastExpression.cs
- FormatterServices.cs
- StylusEditingBehavior.cs
- FileSystemEventArgs.cs
- HttpConfigurationSystem.cs
- NavigationWindow.cs
- UIElement.cs
- CanonicalXml.cs
- ParameterModifier.cs
- DataGridState.cs
- XmlSchemaSimpleContentExtension.cs
- UnsafeNativeMethods.cs
- SqlGenericUtil.cs
- SslStreamSecurityBindingElement.cs
- JsonMessageEncoderFactory.cs
- _ChunkParse.cs
- SapiInterop.cs
- XmlQueryCardinality.cs
- WmiEventSink.cs