Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / EnumType.cs / 1305376 / EnumType.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
// @backupOwner [....]
//---------------------------------------------------------------------
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
- _UriSyntax.cs
- TransactionWaitAsyncResult.cs
- ListViewPagedDataSource.cs
- PlatformCulture.cs
- ActionFrame.cs
- XamlPointCollectionSerializer.cs
- SectionRecord.cs
- HtmlElementErrorEventArgs.cs
- RSAOAEPKeyExchangeDeformatter.cs
- ProcessRequestArgs.cs
- ObjectKeyFrameCollection.cs
- NameScope.cs
- RecordsAffectedEventArgs.cs
- FixedLineResult.cs
- DataPagerFieldCommandEventArgs.cs
- EventSinkActivityDesigner.cs
- HtmlTableRowCollection.cs
- SchemaImporterExtensionElement.cs
- ThreadNeutralSemaphore.cs
- BypassElementCollection.cs
- PerfService.cs
- TypeForwardedToAttribute.cs
- FtpRequestCacheValidator.cs
- HtmlShimManager.cs
- ConfigurationValidatorAttribute.cs
- RowParagraph.cs
- DecimalConverter.cs
- XmlUTF8TextWriter.cs
- Pen.cs
- AttributeUsageAttribute.cs
- ConversionContext.cs
- ConfigsHelper.cs
- ImageFormatConverter.cs
- ExeContext.cs
- WarningException.cs
- SoapElementAttribute.cs
- MessageDecoder.cs
- StreamSecurityUpgradeInitiatorAsyncResult.cs
- JulianCalendar.cs
- CngProvider.cs
- HebrewCalendar.cs
- WebPartHelpVerb.cs
- CollectionBase.cs
- XmlSchemaSet.cs
- RefExpr.cs
- HtmlInputSubmit.cs
- DeploymentSectionCache.cs
- ImageDrawing.cs
- SqlReferenceCollection.cs
- PropertyHelper.cs
- Preprocessor.cs
- ClientUtils.cs
- UnaryExpression.cs
- Material.cs
- PackWebRequestFactory.cs
- ListViewGroup.cs
- EditorZoneBase.cs
- PathFigureCollection.cs
- ResourceDictionary.cs
- ThreadStateException.cs
- FlowNode.cs
- PathSegment.cs
- SqlRowUpdatedEvent.cs
- TransformFinalBlockRequest.cs
- DataServiceExpressionVisitor.cs
- IdleTimeoutMonitor.cs
- RegexWriter.cs
- XmlTextAttribute.cs
- SafeFreeMibTable.cs
- AssemblyAssociatedContentFileAttribute.cs
- LicenseException.cs
- XmlAutoDetectWriter.cs
- ParseChildrenAsPropertiesAttribute.cs
- SafeBitVector32.cs
- ArraySubsetEnumerator.cs
- Bits.cs
- TextParaLineResult.cs
- Unit.cs
- GlobalItem.cs
- TreeBuilderBamlTranslator.cs
- WebPartDescription.cs
- Rect.cs
- RangeValuePattern.cs
- SQLDecimal.cs
- ThicknessKeyFrameCollection.cs
- ConfigurationStrings.cs
- ImageBrush.cs
- XmlDataSource.cs
- ActivationArguments.cs
- Point3DAnimation.cs
- OuterGlowBitmapEffect.cs
- TreeNodeConverter.cs
- StreamWithDictionary.cs
- TargetControlTypeCache.cs
- BypassElementCollection.cs
- Size3DConverter.cs
- PopupEventArgs.cs
- LoginView.cs
- Metadata.cs
- peernodeimplementation.cs