Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / MetadataPropertyAttribute.cs / 1305376 / MetadataPropertyAttribute.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Data.Common; using System.Diagnostics; namespace System.Data.Metadata.Edm { ////// Attribute used to mark up properties that should appear in the MetadataItem.MetadataProperties collection /// [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)] internal sealed class MetadataPropertyAttribute : Attribute { ////// Initializes a new attribute with built in type kind /// /// Built in type setting Type property /// Sets IsCollectionType property internal MetadataPropertyAttribute(BuiltInTypeKind builtInTypeKind, bool isCollectionType) : this(MetadataItem.GetBuiltInType(builtInTypeKind), isCollectionType) { } ////// Initializes a new attribute with primitive type kind /// /// Primitive type setting Type property /// Sets IsCollectionType property internal MetadataPropertyAttribute(PrimitiveTypeKind primitiveTypeKind, bool isCollectionType) : this(MetadataItem.EdmProviderManifest.GetPrimitiveType(primitiveTypeKind), isCollectionType) { } ////// Initialize a new attribute with complex type kind (corresponding the the CLR type) /// /// CLR type setting Type property /// Sets IsCollectionType property internal MetadataPropertyAttribute(Type type, bool isCollection) : this(ClrComplexType.CreateReadonlyClrComplexType(type, type.Namespace ?? string.Empty, type.Name), isCollection) { } ////// Initialize a new attribute /// /// Sets Type property /// Sets IsCollectionType property private MetadataPropertyAttribute(EdmType type, bool isCollectionType) { Debug.Assert(null != type); _type = type; _isCollectionType = isCollectionType; } private readonly EdmType _type; private readonly bool _isCollectionType; ////// Gets EDM type for values stored in property. /// internal EdmType Type { get { return _type; } } ////// Gets bool indicating whether this is a collection type. /// internal bool IsCollectionType { get { return _isCollectionType; } } } } // 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; namespace System.Data.Metadata.Edm { ////// Attribute used to mark up properties that should appear in the MetadataItem.MetadataProperties collection /// [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)] internal sealed class MetadataPropertyAttribute : Attribute { ////// Initializes a new attribute with built in type kind /// /// Built in type setting Type property /// Sets IsCollectionType property internal MetadataPropertyAttribute(BuiltInTypeKind builtInTypeKind, bool isCollectionType) : this(MetadataItem.GetBuiltInType(builtInTypeKind), isCollectionType) { } ////// Initializes a new attribute with primitive type kind /// /// Primitive type setting Type property /// Sets IsCollectionType property internal MetadataPropertyAttribute(PrimitiveTypeKind primitiveTypeKind, bool isCollectionType) : this(MetadataItem.EdmProviderManifest.GetPrimitiveType(primitiveTypeKind), isCollectionType) { } ////// Initialize a new attribute with complex type kind (corresponding the the CLR type) /// /// CLR type setting Type property /// Sets IsCollectionType property internal MetadataPropertyAttribute(Type type, bool isCollection) : this(ClrComplexType.CreateReadonlyClrComplexType(type, type.Namespace ?? string.Empty, type.Name), isCollection) { } ////// Initialize a new attribute /// /// Sets Type property /// Sets IsCollectionType property private MetadataPropertyAttribute(EdmType type, bool isCollectionType) { Debug.Assert(null != type); _type = type; _isCollectionType = isCollectionType; } private readonly EdmType _type; private readonly bool _isCollectionType; ////// Gets EDM type for values stored in property. /// internal EdmType Type { get { return _type; } } ////// Gets bool indicating whether this is a collection type. /// internal bool IsCollectionType { get { return _isCollectionType; } } } } // 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
- BufferedWebEventProvider.cs
- DBSchemaRow.cs
- RTLAwareMessageBox.cs
- FileAuthorizationModule.cs
- MaskedTextBox.cs
- TargetException.cs
- TypePresenter.xaml.cs
- Brush.cs
- ProxySimple.cs
- BitmapEffectInput.cs
- FactoryId.cs
- HttpGetProtocolImporter.cs
- Repeater.cs
- DataPagerFieldItem.cs
- AttributeSetAction.cs
- IConvertible.cs
- NativeMethods.cs
- UriTemplateVariablePathSegment.cs
- GlyphShapingProperties.cs
- DataTableExtensions.cs
- ExecutionScope.cs
- Expression.cs
- IListConverters.cs
- HtmlInputFile.cs
- BevelBitmapEffect.cs
- Bits.cs
- RbTree.cs
- Ref.cs
- WindowHideOrCloseTracker.cs
- UInt16Converter.cs
- Calendar.cs
- Tablet.cs
- PreviewPrintController.cs
- HtmlTableRow.cs
- connectionpool.cs
- ApplicationHost.cs
- XmlQueryTypeFactory.cs
- DocumentCollection.cs
- ExtensibleClassFactory.cs
- ScrollableControl.cs
- HWStack.cs
- Oid.cs
- CurrentTimeZone.cs
- MemoryRecordBuffer.cs
- FieldDescriptor.cs
- SvcFileManager.cs
- HyperLinkField.cs
- EventListenerClientSide.cs
- CodeBlockBuilder.cs
- TypographyProperties.cs
- GraphicsState.cs
- TimeSpanValidatorAttribute.cs
- designeractionbehavior.cs
- InfoCardSymmetricAlgorithm.cs
- Pen.cs
- Profiler.cs
- Matrix3DConverter.cs
- CheckBoxFlatAdapter.cs
- OdbcRowUpdatingEvent.cs
- ConfigurationProperty.cs
- FixedTextSelectionProcessor.cs
- HttpRawResponse.cs
- NameScopePropertyAttribute.cs
- ExtensionQuery.cs
- WindowsStartMenu.cs
- BitmapEffectInputData.cs
- AutoSizeToolBoxItem.cs
- InternalUserCancelledException.cs
- WebBrowserContainer.cs
- ObjectAssociationEndMapping.cs
- ExpressionDumper.cs
- DiscoveryExceptionDictionary.cs
- MemberHolder.cs
- PropertyChange.cs
- Application.cs
- DocumentReferenceCollection.cs
- Link.cs
- TaskExtensions.cs
- HandleCollector.cs
- TrustLevelCollection.cs
- LinqDataSourceContextEventArgs.cs
- Avt.cs
- CompilerCollection.cs
- MailMessageEventArgs.cs
- CellParaClient.cs
- RectangleConverter.cs
- SafeNativeMethods.cs
- KeyTimeConverter.cs
- DiagnosticsConfigurationHandler.cs
- RegexGroupCollection.cs
- DocumentPropertiesDialog.cs
- Quaternion.cs
- WebControlsSection.cs
- GifBitmapEncoder.cs
- PropertyFilterAttribute.cs
- UserValidatedEventArgs.cs
- Image.cs
- PropertyDescriptorCollection.cs
- SHA1Managed.cs
- FixedSOMSemanticBox.cs