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
- MenuEventArgs.cs
- WebExceptionStatus.cs
- DesignerValidationSummaryAdapter.cs
- WebBrowserPermission.cs
- DTCTransactionManager.cs
- TabItem.cs
- GeometryGroup.cs
- ResXFileRef.cs
- QuinticEase.cs
- XmlEntityReference.cs
- GeometryModel3D.cs
- RoleGroupCollection.cs
- QueryFunctions.cs
- BitmapVisualManager.cs
- FullTrustAssembly.cs
- BrowserCapabilitiesFactory.cs
- CommandHelpers.cs
- ExpressionTextBox.xaml.cs
- DrawingImage.cs
- GridViewRow.cs
- PointKeyFrameCollection.cs
- TableCellCollection.cs
- CertificateElement.cs
- TemplatedControlDesigner.cs
- StreamGeometry.cs
- TokenizerHelper.cs
- MaskedTextProvider.cs
- Message.cs
- BehaviorEditorPart.cs
- SizeAnimation.cs
- Size.cs
- RuntimeEnvironment.cs
- ProjectionPlanCompiler.cs
- DesignBindingPicker.cs
- Button.cs
- XmlSchemaAnyAttribute.cs
- ProgramPublisher.cs
- ValidationSummary.cs
- TextServicesHost.cs
- BuildProvidersCompiler.cs
- ConfigXmlText.cs
- XmlDocumentType.cs
- MatrixValueSerializer.cs
- PasswordPropertyTextAttribute.cs
- GroupBoxAutomationPeer.cs
- ComboBox.cs
- InputReport.cs
- Matrix3DStack.cs
- PowerModeChangedEventArgs.cs
- DbConnectionInternal.cs
- MediaEntryAttribute.cs
- TableSectionStyle.cs
- ComboBoxRenderer.cs
- DrawingContextFlattener.cs
- PropVariant.cs
- WebPartUserCapability.cs
- ObjectItemConventionAssemblyLoader.cs
- UndirectedGraph.cs
- HttpConfigurationContext.cs
- FixedDSBuilder.cs
- DriveInfo.cs
- TerminateDesigner.cs
- XmlnsCache.cs
- SqlRemoveConstantOrderBy.cs
- DependencyObjectPropertyDescriptor.cs
- EmptyEnumerable.cs
- PointAnimationClockResource.cs
- Delegate.cs
- StringCollectionMarkupSerializer.cs
- MsmqInputChannel.cs
- PrimitiveXmlSerializers.cs
- ListBoxItemAutomationPeer.cs
- Char.cs
- DataGridViewRowsAddedEventArgs.cs
- DataMember.cs
- SigningCredentials.cs
- SelectionWordBreaker.cs
- EncryptedXml.cs
- MessagePropertyFilter.cs
- IPAddressCollection.cs
- SecurityProtocolCorrelationState.cs
- InstancePersistence.cs
- TextCompositionEventArgs.cs
- PersistencePipeline.cs
- AssertSection.cs
- Stopwatch.cs
- DataGridViewColumnStateChangedEventArgs.cs
- ObjectDataSourceChooseTypePanel.cs
- WebBrowserUriTypeConverter.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- TypeKeyValue.cs
- Button.cs
- HostedHttpTransportManager.cs
- FormParameter.cs
- PnrpPeerResolver.cs
- CursorConverter.cs
- DetailsView.cs
- sortedlist.cs
- XmlSortKeyAccumulator.cs
- InstalledFontCollection.cs