Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- OptimalTextSource.cs
- UserValidatedEventArgs.cs
- LogicalExpr.cs
- DetailsViewUpdateEventArgs.cs
- OperationInvokerBehavior.cs
- DataGridViewColumnEventArgs.cs
- SignatureConfirmationElement.cs
- SQLMembershipProvider.cs
- DesignSurfaceServiceContainer.cs
- XmlLanguageConverter.cs
- FixedBufferAttribute.cs
- PageSettings.cs
- Visual.cs
- KeyValueConfigurationCollection.cs
- Stream.cs
- ListControlConvertEventArgs.cs
- CharacterString.cs
- SqlReorderer.cs
- _SafeNetHandles.cs
- WebPartCatalogAddVerb.cs
- DefaultBinder.cs
- ApplicationBuildProvider.cs
- TemplatedWizardStep.cs
- TextParagraphView.cs
- ZoomPercentageConverter.cs
- DrawingGroup.cs
- ActivationArguments.cs
- DynamicPhysicalDiscoSearcher.cs
- CompositeFontFamily.cs
- TiffBitmapEncoder.cs
- ElementAction.cs
- FixedSOMLineRanges.cs
- DataSourceCache.cs
- ObjectSecurity.cs
- SafeProcessHandle.cs
- RelationHandler.cs
- EqualityComparer.cs
- WindowsGraphicsWrapper.cs
- EntitySetBaseCollection.cs
- GridViewRowEventArgs.cs
- RadioButton.cs
- CorrelationExtension.cs
- WpfWebRequestHelper.cs
- ThumbButtonInfo.cs
- CustomTypeDescriptor.cs
- Operators.cs
- DomainLiteralReader.cs
- DrawingDrawingContext.cs
- DirectoryNotFoundException.cs
- dtdvalidator.cs
- ListBoxAutomationPeer.cs
- RegionInfo.cs
- PropertiesTab.cs
- DbgCompiler.cs
- controlskin.cs
- LineGeometry.cs
- TileModeValidation.cs
- ClientConfigurationHost.cs
- WindowInteropHelper.cs
- BindingExpressionUncommonField.cs
- BuildDependencySet.cs
- XmlTextReaderImpl.cs
- XComponentModel.cs
- CfgParser.cs
- Config.cs
- WeakReferenceList.cs
- CodeNamespaceImportCollection.cs
- RegistrySecurity.cs
- BamlLocalizationDictionary.cs
- ObjectConverter.cs
- GridViewEditEventArgs.cs
- CompositeActivityDesigner.cs
- PasswordTextNavigator.cs
- Helper.cs
- shaperfactoryquerycachekey.cs
- MouseActionValueSerializer.cs
- CharacterString.cs
- ParseHttpDate.cs
- DesignParameter.cs
- DataGridCaption.cs
- BindingListCollectionView.cs
- AnnotationObservableCollection.cs
- AppSettingsExpressionBuilder.cs
- TypeCollectionDesigner.xaml.cs
- ProfileGroupSettingsCollection.cs
- JavascriptCallbackBehaviorAttribute.cs
- PartialClassGenerationTaskInternal.cs
- ReachSerializationUtils.cs
- CompilationAssemblyInstallComponent.cs
- CodePageUtils.cs
- FlowDocumentView.cs
- ReflectionServiceProvider.cs
- KoreanCalendar.cs
- XmlSchemaSet.cs
- xdrvalidator.cs
- ServiceHostingEnvironmentSection.cs
- NetCodeGroup.cs
- _emptywebproxy.cs
- ListViewInsertionMark.cs
- MultiplexingDispatchMessageFormatter.cs