Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Data / System / Data / SqlClient / SqlUdtInfo.cs / 2 / SqlUdtInfo.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All Rights Reserved. // Information Contained Herein is Proprietary and Confidential. // //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data.SqlClient { using System; using System.Collections; using System.Data.Common; using System.Data.Sql; using System.Data.SqlTypes; using System.Diagnostics; using System.Text; using System.IO; using System.Reflection; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; using System.Reflection.Emit; using System.Security.Permissions; using Microsoft.SqlServer.Server; internal class SqlUdtInfo { internal readonly Microsoft.SqlServer.Server.Format SerializationFormat; internal readonly bool IsByteOrdered; internal readonly bool IsFixedLength; internal readonly int MaxByteSize; internal readonly string Name; internal readonly string ValidationMethodName; private SqlUdtInfo(Microsoft.SqlServer.Server.SqlUserDefinedTypeAttribute attr) { SerializationFormat = (Microsoft.SqlServer.Server.Format)attr.Format; IsByteOrdered = attr.IsByteOrdered; IsFixedLength = attr.IsFixedLength; MaxByteSize = attr.MaxByteSize; Name = attr.Name; ValidationMethodName= attr.ValidationMethodName; } internal static SqlUdtInfo GetFromType(Type target) { SqlUdtInfo udtAttr = TryGetFromType(target); if (udtAttr == null) { throw InvalidUdtException.Create(target, Res.SqlUdtReason_NoUdtAttribute); } return udtAttr; } internal static SqlUdtInfo TryGetFromType(Type target) { SqlUdtInfo udtAttr = null; object[] attr = target.GetCustomAttributes(typeof(Microsoft.SqlServer.Server.SqlUserDefinedTypeAttribute), false); if (attr != null && attr.Length == 1) { udtAttr = new SqlUdtInfo((Microsoft.SqlServer.Server.SqlUserDefinedTypeAttribute) attr[0]); } return udtAttr; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All Rights Reserved. // Information Contained Herein is Proprietary and Confidential. // //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data.SqlClient { using System; using System.Collections; using System.Data.Common; using System.Data.Sql; using System.Data.SqlTypes; using System.Diagnostics; using System.Text; using System.IO; using System.Reflection; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; using System.Reflection.Emit; using System.Security.Permissions; using Microsoft.SqlServer.Server; internal class SqlUdtInfo { internal readonly Microsoft.SqlServer.Server.Format SerializationFormat; internal readonly bool IsByteOrdered; internal readonly bool IsFixedLength; internal readonly int MaxByteSize; internal readonly string Name; internal readonly string ValidationMethodName; private SqlUdtInfo(Microsoft.SqlServer.Server.SqlUserDefinedTypeAttribute attr) { SerializationFormat = (Microsoft.SqlServer.Server.Format)attr.Format; IsByteOrdered = attr.IsByteOrdered; IsFixedLength = attr.IsFixedLength; MaxByteSize = attr.MaxByteSize; Name = attr.Name; ValidationMethodName= attr.ValidationMethodName; } internal static SqlUdtInfo GetFromType(Type target) { SqlUdtInfo udtAttr = TryGetFromType(target); if (udtAttr == null) { throw InvalidUdtException.Create(target, Res.SqlUdtReason_NoUdtAttribute); } return udtAttr; } internal static SqlUdtInfo TryGetFromType(Type target) { SqlUdtInfo udtAttr = null; object[] attr = target.GetCustomAttributes(typeof(Microsoft.SqlServer.Server.SqlUserDefinedTypeAttribute), false); if (attr != null && attr.Length == 1) { udtAttr = new SqlUdtInfo((Microsoft.SqlServer.Server.SqlUserDefinedTypeAttribute) attr[0]); } return udtAttr; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SqlRetyper.cs
- DataTableExtensions.cs
- TemplateControl.cs
- ProxyWebPart.cs
- InputScope.cs
- SqlFileStream.cs
- CommandExpr.cs
- ZipIOModeEnforcingStream.cs
- SpecialFolderEnumConverter.cs
- WebPartZone.cs
- StateMachineHelpers.cs
- NullableBoolConverter.cs
- StyleCollection.cs
- ResourcePermissionBaseEntry.cs
- PostBackTrigger.cs
- DesignOnlyAttribute.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- WindowShowOrOpenTracker.cs
- EdmComplexTypeAttribute.cs
- TextCompositionManager.cs
- CustomAttributeFormatException.cs
- ValidatorCollection.cs
- FastPropertyAccessor.cs
- SafeRegistryHandle.cs
- TrustLevelCollection.cs
- FixedMaxHeap.cs
- DurationConverter.cs
- CodeRemoveEventStatement.cs
- XmlIgnoreAttribute.cs
- ScrollProperties.cs
- SimpleRecyclingCache.cs
- InfocardClientCredentials.cs
- TableCellCollection.cs
- ServiceObjectContainer.cs
- DllNotFoundException.cs
- xamlnodes.cs
- StylusPointPropertyUnit.cs
- ProcessHost.cs
- AsyncStreamReader.cs
- ContextQuery.cs
- OleDbException.cs
- FileIOPermission.cs
- ProfileBuildProvider.cs
- SystemIPInterfaceProperties.cs
- SecurityAppliedMessage.cs
- InteropBitmapSource.cs
- InputBinding.cs
- PageCodeDomTreeGenerator.cs
- EntryWrittenEventArgs.cs
- DocumentApplicationJournalEntry.cs
- ResourceType.cs
- CodeRemoveEventStatement.cs
- ReadOnlyMetadataCollection.cs
- MailAddressCollection.cs
- CryptoConfig.cs
- DataContractSerializerOperationGenerator.cs
- XmlLanguageConverter.cs
- PropertyReferenceSerializer.cs
- TagPrefixInfo.cs
- BaseDataList.cs
- SinglePageViewer.cs
- SystemResourceHost.cs
- Int64AnimationUsingKeyFrames.cs
- Point4D.cs
- SplineQuaternionKeyFrame.cs
- ReservationCollection.cs
- Expander.cs
- ToolStripItem.cs
- RectangleGeometry.cs
- SendReply.cs
- DirectoryRedirect.cs
- ClientTargetSection.cs
- RemoteWebConfigurationHost.cs
- RequestCacheValidator.cs
- DataBoundControl.cs
- ImageMapEventArgs.cs
- Instrumentation.cs
- PropertyGroupDescription.cs
- OSEnvironmentHelper.cs
- DisplayMemberTemplateSelector.cs
- SettingsPropertyNotFoundException.cs
- DropDownButton.cs
- CheckedPointers.cs
- PackageDigitalSignatureManager.cs
- CounterCreationDataCollection.cs
- HtmlShimManager.cs
- MatrixCamera.cs
- LayoutManager.cs
- SimpleRecyclingCache.cs
- PropertyNames.cs
- FilteredReadOnlyMetadataCollection.cs
- ReadWriteSpinLock.cs
- XPathPatternBuilder.cs
- PackWebRequest.cs
- ResolveDuplexCD1AsyncResult.cs
- DesignerRegion.cs
- AppSettings.cs
- DataObjectFieldAttribute.cs
- Calendar.cs
- ThemeDirectoryCompiler.cs