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
- DataGridViewAdvancedBorderStyle.cs
- ArgumentDesigner.xaml.cs
- SignatureToken.cs
- EditorAttribute.cs
- DataBindEngine.cs
- MdiWindowListStrip.cs
- ControlCachePolicy.cs
- MulticastOption.cs
- TextBoxView.cs
- CacheMemory.cs
- SocketInformation.cs
- ToolStripDropDownClosingEventArgs.cs
- CursorConverter.cs
- StorageTypeMapping.cs
- PropertyEntry.cs
- GroupBox.cs
- CuspData.cs
- ZipIOCentralDirectoryBlock.cs
- FontStyle.cs
- HostingEnvironmentSection.cs
- SafeProcessHandle.cs
- coordinatorfactory.cs
- DataTableReaderListener.cs
- SessionSwitchEventArgs.cs
- SoapInteropTypes.cs
- Int32Converter.cs
- NotifyIcon.cs
- FolderLevelBuildProvider.cs
- TemplateColumn.cs
- HttpPostProtocolImporter.cs
- Int16Converter.cs
- ClientScriptManagerWrapper.cs
- UpdateException.cs
- TaskScheduler.cs
- SafeMemoryMappedViewHandle.cs
- SerializerWriterEventHandlers.cs
- TraceSwitch.cs
- RequestBringIntoViewEventArgs.cs
- SingleTagSectionHandler.cs
- ExpressionQuoter.cs
- ItemCheckEvent.cs
- HwndSourceParameters.cs
- TextParagraphView.cs
- CachedTypeface.cs
- MSHTMLHost.cs
- __Filters.cs
- EnumerableRowCollectionExtensions.cs
- PropertyManager.cs
- ProtocolsConfiguration.cs
- Utility.cs
- XmlArrayItemAttribute.cs
- FontTypeConverter.cs
- Configuration.cs
- XmlSortKeyAccumulator.cs
- DocumentXmlWriter.cs
- SystemSounds.cs
- XmlSchemaGroupRef.cs
- UrlAuthorizationModule.cs
- ProgressiveCrcCalculatingStream.cs
- SettingsAttributeDictionary.cs
- ProcessModelSection.cs
- HiddenFieldDesigner.cs
- XPathQueryGenerator.cs
- SoapFormatterSinks.cs
- ImportCatalogPart.cs
- TextOnlyOutput.cs
- TabControl.cs
- DataGridViewColumnConverter.cs
- NullableBoolConverter.cs
- Typography.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- ExpanderAutomationPeer.cs
- CorePropertiesFilter.cs
- RelationalExpressions.cs
- Form.cs
- EmptyImpersonationContext.cs
- NativeActivityFaultContext.cs
- MediaScriptCommandRoutedEventArgs.cs
- WebPartConnection.cs
- IsolatedStorageFilePermission.cs
- TreeNodeClickEventArgs.cs
- PointLight.cs
- WebPartUserCapability.cs
- RegexTree.cs
- Scripts.cs
- EllipseGeometry.cs
- FirstMatchCodeGroup.cs
- SpecialNameAttribute.cs
- BinaryMessageFormatter.cs
- PixelFormats.cs
- TerminatorSinks.cs
- DefaultProxySection.cs
- ObjectPersistData.cs
- HelpExampleGenerator.cs
- ImageAttributes.cs
- DllHostedComPlusServiceHost.cs
- DropDownButton.cs
- MaskPropertyEditor.cs
- OleDbDataAdapter.cs
- ReadOnlyMetadataCollection.cs