Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / Microsoft / SqlServer / Server / SmiXetterAccessMap.cs / 1305376 / SmiXetterAccessMap.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- namespace Microsoft.SqlServer.Server { using System; using System.Diagnostics; // Formal encoding of SMI's metadata-to-ITypedSetter/-from-ITypedGetter validity rules internal class SmiXetterAccessMap { // A couple of private constants to make the getter/setter access tables more readable private const bool X = true; private const bool _ = false; private static bool[,] __isGetterAccessValid = { // Getters as columns (abreviated from XetterTypeCode names) // SqlDbTypes as rows // bool, byte, bytes, chars, strng, int16, int32, int64, singl, doubl, sqldec, date, guid, varmd, Xetr, time, dtost /*BigInt*/ { _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Binary*/ { _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Bit*/ { X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Char*/ { _ , _ , X , X , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*DTime*/ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , }, /*Decimal*/ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , _ , }, /*Float*/ { _ , _ , _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , _ , _ , }, /*Image*/ { _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Int*/ { _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Money*/ { _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*NChar*/ { _ , _ , X , X , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*NText*/ { _ , _ , X , X , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*NVarChar*/{ _ , _ , X , X , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Real*/ { _ , _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , }, /*UniqueId*/{ _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , }, /*SmDTime*/ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , }, /*SmInt*/ { _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*SmMoney*/ { _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Text*/ { _ , _ , X , X , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Tstamp*/ { _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*TinyInt*/ { _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*VarBin*/ { _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*VarChar*/ { _ , _ , X , X , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Variant*/ { X , X , X , X , X , X , X , X , X , X , X , X , X , X , _ , X , X , }, /* 24 */ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Xml*/ { _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /* 26 */ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /* 27 */ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /* 28 */ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Udt*/ { _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Struct*/ { _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , X , _ , _ , }, /*Date*/ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , }, /*Time*/ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , X , _ , }, /*DTime2*/ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , }, /*DTOffset*/{ _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , X , }, }; private static bool[,] __isSetterAccessValid = { // Setters as columns (abreviated from XetterTypeCode names) // SqlDbTypes as rows // Current difference between setters and getters is that character setters do // not need to support SetBytes // bool, byte, bytes, chars, strng, int16, int32, int64, singl, doubl, sqldec, date, guid, varmd, Xetr, time, dtost /*BigInt*/ { _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Binary*/ { _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Bit*/ { X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Char*/ { _ , _ , _ , X , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*DTime*/ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , }, /*Decimal*/ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , _ , }, /*Float*/ { _ , _ , _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , _ , _ , }, /*Image*/ { _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Int*/ { _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Money*/ { _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*NChar*/ { _ , _ , _ , X , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*NText*/ { _ , _ , _ , X , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*NVarChar*/{ _ , _ , _ , X , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Real*/ { _ , _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , }, /*UniqueId*/{ _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , }, /*SmDTime*/ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , }, /*SmInt*/ { _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*SmMoney*/ { _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Text*/ { _ , _ , _ , X , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Tstamp*/ { _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*TinyInt*/ { _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*VarBin*/ { _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*VarChar*/ { _ , _ , _ , X , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Variant*/ { X , X , X , X , X , X , X , X , X , X , X , X , X , X , _ , X , X , }, /* 24 */ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Xml*/ { _ , _ , X , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /* 26 */ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /* 27 */ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /* 28 */ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Udt*/ { _ , _ , X , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , }, /*Struct*/ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , X , _ , _ , }, /*Date*/ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , }, /*Time*/ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , X , _ , }, /*DTime2*/ { _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , X , _ , _ , _ , _ , _ , }, /*DTOffset*/{ _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , _ , X , }, }; internal static bool IsGetterAccessValid( SmiMetaData metaData, SmiXetterTypeCode xetterType ) { // Make sure no-one adds a new xetter type without updating this file! Debug.Assert( SmiXetterTypeCode.XetBoolean <= xetterType && SmiXetterTypeCode.XetDateTimeOffset >= xetterType ); return __isGetterAccessValid[(int) metaData.SqlDbType, (int) xetterType]; } internal static bool IsSetterAccessValid( SmiMetaData metaData, SmiXetterTypeCode xetterType ) { // Make sure no-one adds a new xetter type without updating this file! Debug.Assert(SmiXetterTypeCode.XetBoolean <= xetterType && SmiXetterTypeCode.XetDateTimeOffset >= xetterType && SmiXetterTypeCode.GetVariantMetaData != xetterType); return __isSetterAccessValid[(int) metaData.SqlDbType, (int) xetterType]; } } } // 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
- ScriptControlManager.cs
- ButtonChrome.cs
- FixedSOMTable.cs
- PeerDefaultCustomResolverClient.cs
- Inflater.cs
- GlobalizationSection.cs
- SpotLight.cs
- ColorMap.cs
- QueueProcessor.cs
- Win32SafeHandles.cs
- XmlSchemaInferenceException.cs
- CompressionTransform.cs
- CollectionViewGroupRoot.cs
- PageTheme.cs
- XmlnsCompatibleWithAttribute.cs
- MaterialGroup.cs
- CharConverter.cs
- ISSmlParser.cs
- CodeTypeMemberCollection.cs
- FilePrompt.cs
- DataColumnMappingCollection.cs
- MethodRental.cs
- SizeIndependentAnimationStorage.cs
- GatewayDefinition.cs
- RSACryptoServiceProvider.cs
- DependencyPropertyConverter.cs
- AssemblyAssociatedContentFileAttribute.cs
- PagesChangedEventArgs.cs
- GridViewEditEventArgs.cs
- BrushValueSerializer.cs
- ForceCopyBuildProvider.cs
- Transactions.cs
- StrongTypingException.cs
- HashCodeCombiner.cs
- Axis.cs
- ParserStreamGeometryContext.cs
- Timer.cs
- ProviderSettings.cs
- CodeExpressionCollection.cs
- XsltContext.cs
- EntityDataSourceColumn.cs
- DefaultAssemblyResolver.cs
- CommandDevice.cs
- FontUnit.cs
- VersionedStream.cs
- DNS.cs
- DrawingState.cs
- WebPartEditorOkVerb.cs
- DescriptionAttribute.cs
- HttpContext.cs
- ClassHandlersStore.cs
- TransactionFlowProperty.cs
- log.cs
- PerformanceCounterPermission.cs
- figurelength.cs
- IDispatchConstantAttribute.cs
- HtmlDocument.cs
- Roles.cs
- Propagator.cs
- DataObjectPastingEventArgs.cs
- CompilationRelaxations.cs
- SafeRightsManagementSessionHandle.cs
- Setter.cs
- TerminateWorkflow.cs
- ConnectorDragDropGlyph.cs
- Form.cs
- X509ChainPolicy.cs
- GeometryModel3D.cs
- CounterCreationData.cs
- ErrorWebPart.cs
- TraceContextEventArgs.cs
- SpellCheck.cs
- WasEndpointConfigContainer.cs
- ModelChangedEventArgsImpl.cs
- _HeaderInfoTable.cs
- ClientOptions.cs
- DependencyProperty.cs
- FormViewCommandEventArgs.cs
- SystemColors.cs
- KeyEvent.cs
- GestureRecognitionResult.cs
- XmlProcessingInstruction.cs
- ByeMessageCD1.cs
- WindowsFormsHostPropertyMap.cs
- WebPartRestoreVerb.cs
- ComponentManagerBroker.cs
- SmtpNtlmAuthenticationModule.cs
- EventMappingSettings.cs
- HtmlButton.cs
- CodeGen.cs
- OSFeature.cs
- DataMisalignedException.cs
- CompModSwitches.cs
- Walker.cs
- DesignerForm.cs
- FormViewUpdatedEventArgs.cs
- TreeNodeConverter.cs
- ChooseAction.cs
- XmlArrayItemAttribute.cs
- FormViewCommandEventArgs.cs