Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / EdmMember.cs / 1305376 / EdmMember.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Data.Common; using System.Diagnostics; using System.Text; namespace System.Data.Metadata.Edm { ////// Represents the edm member class /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Edm")] public abstract class EdmMember : MetadataItem { ////// Initializes a new instance of EdmMember class /// /// name of the member /// type information containing info about member's type and its facet internal EdmMember(string name, TypeUsage memberTypeUsage) { EntityUtil.CheckStringArgument(name, "name"); EntityUtil.GenericCheckArgumentNull(memberTypeUsage, "memberTypeUsage"); _name = name; _typeUsage = memberTypeUsage; } private TypeUsage _typeUsage; private string _name; private StructuralType _declaringType; ////// Returns the identity of the member /// internal override string Identity { get { return this.Name; } } ////// Returns the name of the member /// [MetadataProperty(PrimitiveTypeKind.String, false)] public String Name { get { return _name; } } ////// Returns the declaring type of the member /// public StructuralType DeclaringType { get { return _declaringType; } } ////// Returns the TypeUsage object containing the type information and facets /// about the type /// [MetadataProperty(BuiltInTypeKind.TypeUsage, false)] public TypeUsage TypeUsage { get { return _typeUsage; } } ////// Overriding System.Object.ToString to provide better String representation /// for this type. /// public override string ToString() { return Name; } ////// Sets the member to read only mode. Once this is done, there are no changes /// that can be done to this class /// internal override void SetReadOnly() { if (!IsReadOnly) { base.SetReadOnly(); // TypeUsage is always readonly, no need to set it } } ////// Change the declaring type without doing fixup in the member collection /// internal void ChangeDeclaringTypeWithoutCollectionFixup(StructuralType newDeclaringType) { _declaringType = newDeclaringType; } ////// Tells whether this member is marked as a Computed member in the EDM definition /// internal bool IsStoreGeneratedComputed { get { Facet item=null; if (TypeUsage.Facets.TryGetValue(EdmProviderManifest.StoreGeneratedPatternFacetName, false, out item)) { return ((StoreGeneratedPattern)item.Value) == StoreGeneratedPattern.Computed; } return false; } } ////// Tells whether this member's Store generated pattern is marked as Identity in the EDM definition /// internal bool IsStoreGeneratedIdentity { get { Facet item = null; if (TypeUsage.Facets.TryGetValue(EdmProviderManifest.StoreGeneratedPatternFacetName, false, out item)) { return ((StoreGeneratedPattern)item.Value) == StoreGeneratedPattern.Identity; } return false; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Data.Common; using System.Diagnostics; using System.Text; namespace System.Data.Metadata.Edm { ////// Represents the edm member class /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Edm")] public abstract class EdmMember : MetadataItem { ////// Initializes a new instance of EdmMember class /// /// name of the member /// type information containing info about member's type and its facet internal EdmMember(string name, TypeUsage memberTypeUsage) { EntityUtil.CheckStringArgument(name, "name"); EntityUtil.GenericCheckArgumentNull(memberTypeUsage, "memberTypeUsage"); _name = name; _typeUsage = memberTypeUsage; } private TypeUsage _typeUsage; private string _name; private StructuralType _declaringType; ////// Returns the identity of the member /// internal override string Identity { get { return this.Name; } } ////// Returns the name of the member /// [MetadataProperty(PrimitiveTypeKind.String, false)] public String Name { get { return _name; } } ////// Returns the declaring type of the member /// public StructuralType DeclaringType { get { return _declaringType; } } ////// Returns the TypeUsage object containing the type information and facets /// about the type /// [MetadataProperty(BuiltInTypeKind.TypeUsage, false)] public TypeUsage TypeUsage { get { return _typeUsage; } } ////// Overriding System.Object.ToString to provide better String representation /// for this type. /// public override string ToString() { return Name; } ////// Sets the member to read only mode. Once this is done, there are no changes /// that can be done to this class /// internal override void SetReadOnly() { if (!IsReadOnly) { base.SetReadOnly(); // TypeUsage is always readonly, no need to set it } } ////// Change the declaring type without doing fixup in the member collection /// internal void ChangeDeclaringTypeWithoutCollectionFixup(StructuralType newDeclaringType) { _declaringType = newDeclaringType; } ////// Tells whether this member is marked as a Computed member in the EDM definition /// internal bool IsStoreGeneratedComputed { get { Facet item=null; if (TypeUsage.Facets.TryGetValue(EdmProviderManifest.StoreGeneratedPatternFacetName, false, out item)) { return ((StoreGeneratedPattern)item.Value) == StoreGeneratedPattern.Computed; } return false; } } ////// Tells whether this member's Store generated pattern is marked as Identity in the EDM definition /// internal bool IsStoreGeneratedIdentity { get { Facet item = null; if (TypeUsage.Facets.TryGetValue(EdmProviderManifest.StoreGeneratedPatternFacetName, false, out item)) { return ((StoreGeneratedPattern)item.Value) == StoreGeneratedPattern.Identity; } return false; } } } } // 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
- HttpModuleActionCollection.cs
- EventEntry.cs
- HandoffBehavior.cs
- SimpleRecyclingCache.cs
- EntityContainerEntitySet.cs
- ListBase.cs
- Matrix3D.cs
- XmlCountingReader.cs
- DataListGeneralPage.cs
- InvalidOleVariantTypeException.cs
- GetMemberBinder.cs
- PeerName.cs
- DynamicControl.cs
- BitmapMetadataEnumerator.cs
- PreviewControlDesigner.cs
- StrokeFIndices.cs
- TemplateControlParser.cs
- DataGridViewAdvancedBorderStyle.cs
- Pens.cs
- sortedlist.cs
- DataGridViewBindingCompleteEventArgs.cs
- __ConsoleStream.cs
- DispatcherFrame.cs
- CustomAttributeSerializer.cs
- GCHandleCookieTable.cs
- DriveNotFoundException.cs
- SelectorAutomationPeer.cs
- GenericPrincipal.cs
- XmlTypeAttribute.cs
- PolyBezierSegment.cs
- XmlnsCompatibleWithAttribute.cs
- HeaderedItemsControl.cs
- QilBinary.cs
- DBDataPermission.cs
- ClientRoleProvider.cs
- FileInfo.cs
- GeneralTransform3DCollection.cs
- SearchForVirtualItemEventArgs.cs
- WebPartDescriptionCollection.cs
- X509Utils.cs
- UserControlAutomationPeer.cs
- InstallerTypeAttribute.cs
- ITextView.cs
- QuinticEase.cs
- CompositionAdorner.cs
- TableLayoutPanel.cs
- BitmapData.cs
- WindowsImpersonationContext.cs
- BamlReader.cs
- StateMachineExecutionState.cs
- Dictionary.cs
- Line.cs
- DataGridViewCellPaintingEventArgs.cs
- ObjectStateManagerMetadata.cs
- ellipse.cs
- EncoderFallback.cs
- Image.cs
- ProfileGroupSettings.cs
- ReadingWritingEntityEventArgs.cs
- EditorAttribute.cs
- TaskFileService.cs
- QuotedPrintableStream.cs
- DragEvent.cs
- EntitySetRetriever.cs
- DoubleUtil.cs
- PeerNameRecord.cs
- WebUtil.cs
- HealthMonitoringSectionHelper.cs
- TableLayoutPanelCellPosition.cs
- DiffuseMaterial.cs
- WebPartsPersonalizationAuthorization.cs
- ToolStripDropDownClosedEventArgs.cs
- TemplateGroupCollection.cs
- CollectionBuilder.cs
- DBCommand.cs
- SystemParameters.cs
- NamespaceMapping.cs
- Rotation3DAnimation.cs
- ExpandCollapseIsCheckedConverter.cs
- FileLevelControlBuilderAttribute.cs
- HiddenFieldPageStatePersister.cs
- ObjectPropertyMapping.cs
- RoleService.cs
- OleDbPermission.cs
- Pair.cs
- MenuBase.cs
- Attributes.cs
- LayoutSettings.cs
- DefaultTextStoreTextComposition.cs
- UserMapPath.cs
- StrongName.cs
- ReverseComparer.cs
- IssuedTokenServiceCredential.cs
- ReflectionTypeLoadException.cs
- ViewEventArgs.cs
- SemanticResultKey.cs
- RevocationPoint.cs
- XpsStructure.cs
- Config.cs
- ToolStripStatusLabel.cs