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
- PassportAuthenticationModule.cs
- GeneralTransform3DCollection.cs
- Listbox.cs
- JournalNavigationScope.cs
- _ProxyChain.cs
- Int64AnimationBase.cs
- XmlQueryCardinality.cs
- RoutedPropertyChangedEventArgs.cs
- SelectionEditor.cs
- SerializationFieldInfo.cs
- PropertyNames.cs
- DataGridViewCellValueEventArgs.cs
- ConstructorNeedsTagAttribute.cs
- VisualStates.cs
- WebZone.cs
- XmlWrappingWriter.cs
- BitmapSizeOptions.cs
- TableStyle.cs
- XappLauncher.cs
- ParseElementCollection.cs
- TextViewBase.cs
- Rectangle.cs
- PropertyBuilder.cs
- TextDecorationCollection.cs
- DataSourceCacheDurationConverter.cs
- WebSysDefaultValueAttribute.cs
- TrackBarRenderer.cs
- SafeBuffer.cs
- CollectionEditor.cs
- BypassElementCollection.cs
- MemoryMappedViewStream.cs
- HttpCacheVaryByContentEncodings.cs
- OutputCacheProfileCollection.cs
- wmiprovider.cs
- MimeTypePropertyAttribute.cs
- ScrollItemPatternIdentifiers.cs
- AttributeExtensions.cs
- InvokeProviderWrapper.cs
- SqlVisitor.cs
- DeclarationUpdate.cs
- AdornerHitTestResult.cs
- WindowShowOrOpenTracker.cs
- FlowDocumentPaginator.cs
- XmlAttributeProperties.cs
- UIElement3D.cs
- PermissionSetTriple.cs
- XDeferredAxisSource.cs
- ProfileParameter.cs
- ClickablePoint.cs
- TargetConverter.cs
- MD5HashHelper.cs
- SRGSCompiler.cs
- PhysicalAddress.cs
- ModuleElement.cs
- RestHandlerFactory.cs
- XComponentModel.cs
- SQLInt16.cs
- SqlUtils.cs
- TextEffectResolver.cs
- QueryContinueDragEvent.cs
- DatePickerAutomationPeer.cs
- Speller.cs
- BindingNavigator.cs
- DbMetaDataColumnNames.cs
- SchemaAttDef.cs
- ClientScriptManagerWrapper.cs
- UnknownWrapper.cs
- SqlMethodAttribute.cs
- FlowLayoutSettings.cs
- TransformGroup.cs
- MimeBasePart.cs
- DelegatingConfigHost.cs
- QilFactory.cs
- SqlClientWrapperSmiStreamChars.cs
- RetrieveVirtualItemEventArgs.cs
- BrushConverter.cs
- NonSerializedAttribute.cs
- DispatcherProcessingDisabled.cs
- DragEvent.cs
- ReturnEventArgs.cs
- ClientCultureInfo.cs
- ClientSettingsStore.cs
- HwndHost.cs
- ImageIndexEditor.cs
- BezierSegment.cs
- Label.cs
- CharacterHit.cs
- XPathMultyIterator.cs
- RelatedCurrencyManager.cs
- ObjectDataSourceStatusEventArgs.cs
- DataGridParentRows.cs
- Int32Converter.cs
- PrintPreviewControl.cs
- SymmetricCryptoHandle.cs
- TrackingQueryElement.cs
- Selection.cs
- FixedSOMTextRun.cs
- CompModSwitches.cs
- PassportAuthentication.cs
- EventMappingSettingsCollection.cs