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
- SrgsToken.cs
- WebPartCatalogCloseVerb.cs
- streamingZipPartStream.cs
- X509Certificate.cs
- DelegateSerializationHolder.cs
- RuntimeConfigurationRecord.cs
- XmlnsDefinitionAttribute.cs
- SchemaNotation.cs
- ScriptReferenceEventArgs.cs
- CommandValueSerializer.cs
- RawMouseInputReport.cs
- ObjectStateEntry.cs
- Interlocked.cs
- Shape.cs
- WebReference.cs
- SQLInt64.cs
- MetadataException.cs
- DataContract.cs
- HostTimeoutsElement.cs
- XPathDescendantIterator.cs
- BulletDecorator.cs
- CapabilitiesAssignment.cs
- SoapCodeExporter.cs
- VirtualPathProvider.cs
- DocumentCollection.cs
- SizeAnimationBase.cs
- NeutralResourcesLanguageAttribute.cs
- FindRequestContext.cs
- ActiveXContainer.cs
- Literal.cs
- DesigntimeLicenseContext.cs
- UInt16Storage.cs
- GPPOINT.cs
- ToggleProviderWrapper.cs
- ReflectPropertyDescriptor.cs
- EntityDataSourceQueryBuilder.cs
- Expression.cs
- ValidatedControlConverter.cs
- DataGridViewRowCancelEventArgs.cs
- DataRowView.cs
- ProcessModuleCollection.cs
- DesignerVerb.cs
- XmlSchemaGroupRef.cs
- OutputCacheProfileCollection.cs
- XmlParser.cs
- StrongTypingException.cs
- LineInfo.cs
- AddInAttribute.cs
- ConditionChanges.cs
- ClientTargetCollection.cs
- messageonlyhwndwrapper.cs
- ExpressionBuilderCollection.cs
- MobileTemplatedControlDesigner.cs
- InputLanguageEventArgs.cs
- JavascriptCallbackMessageInspector.cs
- SerialPort.cs
- Vector3DAnimation.cs
- TextTreePropertyUndoUnit.cs
- SqlMetaData.cs
- UnaryExpressionHelper.cs
- InvalidCastException.cs
- ProgressBarHighlightConverter.cs
- WebPartVerbsEventArgs.cs
- SignedXml.cs
- RSACryptoServiceProvider.cs
- SecurityRuntime.cs
- ToolStripOverflowButton.cs
- DataGridViewCellMouseEventArgs.cs
- DiscoveryExceptionDictionary.cs
- ProcessDesigner.cs
- FormViewPageEventArgs.cs
- ChannelAcceptor.cs
- EntityTypeEmitter.cs
- ToolStripGrip.cs
- SqlCaseSimplifier.cs
- SharedUtils.cs
- FramingEncoders.cs
- Image.cs
- GACIdentityPermission.cs
- XmlAnyElementAttribute.cs
- SecurityToken.cs
- _Events.cs
- BuildResultCache.cs
- Grid.cs
- XmlCharType.cs
- TextPointer.cs
- LocatorGroup.cs
- RsaKeyIdentifierClause.cs
- PartitionResolver.cs
- CharStorage.cs
- ChannelManager.cs
- RemoteWebConfigurationHost.cs
- Assembly.cs
- TextDpi.cs
- TextEditorCharacters.cs
- VariableDesigner.xaml.cs
- SQLMembershipProvider.cs
- DataBoundLiteralControl.cs
- XmlQueryContext.cs
- FileBasedResourceGroveler.cs