Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / EnumType.cs / 2 / EnumType.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....], [....]
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
{
using System.Data.Common;
///
/// Class representing a enumeration type
///
internal sealed class EnumType : SimpleType
{
#region Constructors
///
/// The default constructor for EnumType: for bootstraping
///
internal EnumType()
{
}
///
/// The constructor for EnumType. It takes the required information to identify this type.
///
/// The name of this type
/// The namespace name of this type
/// The version of this type
/// dataspace in which the enum belongs to
/// Thrown if either name, namespace or version arguments are null
internal EnumType(string name, string namespaceName, DataSpace dataSpace)
: base(name, namespaceName, dataSpace)
{
}
#endregion
#region Fields
private readonly ReadOnlyMetadataCollection _enumMembers = new ReadOnlyMetadataCollection(new MetadataCollection());
#endregion
#region Properties
///
/// Returns the kind of the type
///
public override BuiltInTypeKind BuiltInTypeKind { get { return BuiltInTypeKind.EnumType; } }
///
/// The collection of enumeration members belong to this enumeration type
///
[MetadataProperty(BuiltInTypeKind.EnumMember, true)]
public ReadOnlyMetadataCollection EnumMembers
{
get
{
return _enumMembers;
}
}
///
/// Sets this item to be readonly, once this is set, the item will never be writable again.
///
internal override void SetReadOnly()
{
if (!IsReadOnly)
{
base.SetReadOnly();
this.EnumMembers.Source.SetReadOnly();
}
}
///
/// Adds the given member to the member collection
///
///
internal void AddMember(EnumMember enumMember)
{
this.EnumMembers.Source.Add(enumMember);
}
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....], [....]
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
{
using System.Data.Common;
///
/// Class representing a enumeration type
///
internal sealed class EnumType : SimpleType
{
#region Constructors
///
/// The default constructor for EnumType: for bootstraping
///
internal EnumType()
{
}
///
/// The constructor for EnumType. It takes the required information to identify this type.
///
/// The name of this type
/// The namespace name of this type
/// The version of this type
/// dataspace in which the enum belongs to
/// Thrown if either name, namespace or version arguments are null
internal EnumType(string name, string namespaceName, DataSpace dataSpace)
: base(name, namespaceName, dataSpace)
{
}
#endregion
#region Fields
private readonly ReadOnlyMetadataCollection _enumMembers = new ReadOnlyMetadataCollection(new MetadataCollection());
#endregion
#region Properties
///
/// Returns the kind of the type
///
public override BuiltInTypeKind BuiltInTypeKind { get { return BuiltInTypeKind.EnumType; } }
///
/// The collection of enumeration members belong to this enumeration type
///
[MetadataProperty(BuiltInTypeKind.EnumMember, true)]
public ReadOnlyMetadataCollection EnumMembers
{
get
{
return _enumMembers;
}
}
///
/// Sets this item to be readonly, once this is set, the item will never be writable again.
///
internal override void SetReadOnly()
{
if (!IsReadOnly)
{
base.SetReadOnly();
this.EnumMembers.Source.SetReadOnly();
}
}
///
/// Adds the given member to the member collection
///
///
internal void AddMember(EnumMember enumMember)
{
this.EnumMembers.Source.Add(enumMember);
}
#endregion
}
}
// 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
- DocumentPageViewAutomationPeer.cs
- ApplicationSettingsBase.cs
- SqlConnectionPoolGroupProviderInfo.cs
- Crc32Helper.cs
- EntityCommandDefinition.cs
- DrawingVisual.cs
- XmlSchemaGroup.cs
- SmiRecordBuffer.cs
- PropertyGrid.cs
- VisualStyleTypesAndProperties.cs
- ProxyHelper.cs
- ImageField.cs
- SafeCoTaskMem.cs
- TargetControlTypeCache.cs
- TextEditorSelection.cs
- BuildProviderCollection.cs
- MatrixTransform3D.cs
- DeriveBytes.cs
- login.cs
- QueueException.cs
- SqlServices.cs
- Vector.cs
- IsolatedStorageException.cs
- Token.cs
- XsdBuilder.cs
- CompModSwitches.cs
- QueryRelOp.cs
- DiscoveryMessageSequence.cs
- ViewStateModeByIdAttribute.cs
- TimeManager.cs
- BroadcastEventHelper.cs
- WorkflowInstanceExtensionManager.cs
- DataSetFieldSchema.cs
- PointUtil.cs
- MbpInfo.cs
- XmlObjectSerializerWriteContextComplex.cs
- DataContractSerializerSection.cs
- RepeaterDataBoundAdapter.cs
- UniqueIdentifierService.cs
- StringPropertyBuilder.cs
- TextElementAutomationPeer.cs
- TabletDeviceInfo.cs
- WorkflowFileItem.cs
- EntityKey.cs
- ErrorEventArgs.cs
- BuildResultCache.cs
- ProcessInputEventArgs.cs
- ValidatingPropertiesEventArgs.cs
- TimeSpanConverter.cs
- ResourceDisplayNameAttribute.cs
- AuthenticationService.cs
- ExpressionParser.cs
- Formatter.cs
- LinearQuaternionKeyFrame.cs
- XmlSchemas.cs
- DecimalKeyFrameCollection.cs
- ControlParameter.cs
- OperationDescriptionCollection.cs
- EditCommandColumn.cs
- TreeView.cs
- RoleManagerEventArgs.cs
- MenuScrollingVisibilityConverter.cs
- ConfigurationSettings.cs
- Stylus.cs
- PageClientProxyGenerator.cs
- Array.cs
- ExpressionUtilities.cs
- ClipboardProcessor.cs
- ToolStripSeparator.cs
- VirtualPathData.cs
- CodeTypeReferenceCollection.cs
- WebPartEventArgs.cs
- DatatypeImplementation.cs
- RsaSecurityTokenAuthenticator.cs
- Guid.cs
- EditorZoneBase.cs
- ProcessModule.cs
- CompilerErrorCollection.cs
- HttpAsyncResult.cs
- _PooledStream.cs
- CodeEntryPointMethod.cs
- TypeReference.cs
- NullableFloatMinMaxAggregationOperator.cs
- ObjectNotFoundException.cs
- IPEndPointCollection.cs
- HtmlInputPassword.cs
- DefaultHttpHandler.cs
- ColumnMapCopier.cs
- AssemblyAttributes.cs
- Gdiplus.cs
- RuntimeArgument.cs
- MessageContractExporter.cs
- AliasedExpr.cs
- Missing.cs
- NativeMethods.cs
- GrammarBuilderDictation.cs
- BrushConverter.cs
- UnionExpr.cs
- ProfileGroupSettingsCollection.cs
- ReaderContextStackData.cs