Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Data / System / Data / SqlClient / SqlUdtInfo.cs / 1 / 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
- ConfigurationValues.cs
- ScheduleChanges.cs
- ClosureBinding.cs
- SchemaEntity.cs
- SchemaMapping.cs
- wgx_commands.cs
- GuidTagList.cs
- ParseChildrenAsPropertiesAttribute.cs
- UInt64Storage.cs
- IpcClientManager.cs
- ChineseLunisolarCalendar.cs
- SharedConnectionListener.cs
- CurrentChangedEventManager.cs
- AuthorizationSection.cs
- WebPartConnectionsEventArgs.cs
- ParagraphVisual.cs
- ThicknessKeyFrameCollection.cs
- BindingObserver.cs
- VariableDesigner.xaml.cs
- DrawListViewItemEventArgs.cs
- URLAttribute.cs
- OutputCacheSettingsSection.cs
- BlurEffect.cs
- Image.cs
- CreateUserWizardAutoFormat.cs
- MsmqIntegrationSecurityElement.cs
- OpenTypeCommon.cs
- AssemblyHash.cs
- HwndSource.cs
- TypeConverterAttribute.cs
- NavigationWindowAutomationPeer.cs
- HGlobalSafeHandle.cs
- TimeoutConverter.cs
- XmlWhitespace.cs
- EnumDataContract.cs
- brushes.cs
- FileDialog.cs
- XPathDocument.cs
- IResourceProvider.cs
- Memoizer.cs
- AssertHelper.cs
- SequentialUshortCollection.cs
- XsdDateTime.cs
- HtmlForm.cs
- DataBoundLiteralControl.cs
- IdentityManager.cs
- RenameRuleObjectDialog.Designer.cs
- NoneExcludedImageIndexConverter.cs
- MouseGesture.cs
- HelpKeywordAttribute.cs
- ExtendedProtectionPolicy.cs
- Properties.cs
- ChtmlFormAdapter.cs
- mda.cs
- CharacterBufferReference.cs
- SchemaManager.cs
- GenericTypeParameterBuilder.cs
- MimeFormReflector.cs
- DataControlButton.cs
- FormatterConverter.cs
- DataSetSchema.cs
- _NetworkingPerfCounters.cs
- FunctionOverloadResolver.cs
- GlobalAllocSafeHandle.cs
- IISUnsafeMethods.cs
- AttributeData.cs
- DynamicDocumentPaginator.cs
- MissingMemberException.cs
- QilBinary.cs
- WebBrowserEvent.cs
- RealProxy.cs
- SmtpFailedRecipientException.cs
- UIElementParagraph.cs
- SecurityUtils.cs
- CodeAccessSecurityEngine.cs
- WindowsRichEdit.cs
- WebPartCatalogAddVerb.cs
- Accessible.cs
- ColorKeyFrameCollection.cs
- TileModeValidation.cs
- DeviceContext.cs
- PropertyDescriptorCollection.cs
- ValueUtilsSmi.cs
- DependencySource.cs
- WebReferencesBuildProvider.cs
- recordstate.cs
- MissingFieldException.cs
- PointLight.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- Journal.cs
- TextBoxBase.cs
- BuildManagerHost.cs
- ContextMenuStripGroupCollection.cs
- ArgumentsParser.cs
- DataGridViewCellStyle.cs
- EntityTemplateFactory.cs
- HuffModule.cs
- StatusBarPanelClickEvent.cs
- XhtmlBasicValidationSummaryAdapter.cs
- AnnotationHelper.cs