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
- BamlBinaryWriter.cs
- Utils.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- ResourceDisplayNameAttribute.cs
- DbProviderManifest.cs
- TextProperties.cs
- DigestComparer.cs
- UriWriter.cs
- PropertyToken.cs
- SchemaDeclBase.cs
- StringConverter.cs
- UnitySerializationHolder.cs
- _Events.cs
- GridItem.cs
- EntityDataSourceMemberPath.cs
- XsdDataContractImporter.cs
- MaskInputRejectedEventArgs.cs
- DataRowChangeEvent.cs
- TraceLog.cs
- MailSettingsSection.cs
- NegotiateStream.cs
- XmlDataSourceNodeDescriptor.cs
- VariableExpressionConverter.cs
- PlatformNotSupportedException.cs
- WriterOutput.cs
- DoubleLink.cs
- SerializationInfo.cs
- ContractBase.cs
- TableCellAutomationPeer.cs
- ResXFileRef.cs
- WebServiceTypeData.cs
- HostVisual.cs
- HwndSourceParameters.cs
- TriggerActionCollection.cs
- LambdaCompiler.Generated.cs
- TextRangeProviderWrapper.cs
- FtpWebRequest.cs
- EntryWrittenEventArgs.cs
- WebBrowserDesigner.cs
- AtomParser.cs
- StatusBarPanel.cs
- TitleStyle.cs
- CompiledXpathExpr.cs
- TextModifier.cs
- PointLight.cs
- TreeNode.cs
- _IPv6Address.cs
- ToolboxItemImageConverter.cs
- ServiceModelExtensionCollectionElement.cs
- XmlUTF8TextReader.cs
- SafeProcessHandle.cs
- AdapterUtil.cs
- LayoutEngine.cs
- RemoteWebConfigurationHostServer.cs
- TimeoutValidationAttribute.cs
- HtmlControlPersistable.cs
- WmpBitmapDecoder.cs
- PowerEase.cs
- ListViewEditEventArgs.cs
- CompiledQueryCacheEntry.cs
- BoundPropertyEntry.cs
- MergePropertyDescriptor.cs
- _LocalDataStore.cs
- WebEventCodes.cs
- WeakHashtable.cs
- TypeConvertions.cs
- ReflectTypeDescriptionProvider.cs
- HatchBrush.cs
- EventDrivenDesigner.cs
- HorizontalAlignConverter.cs
- HorizontalAlignConverter.cs
- WebPageTraceListener.cs
- FileInfo.cs
- StringInfo.cs
- PresentationAppDomainManager.cs
- bidPrivateBase.cs
- CodeSnippetTypeMember.cs
- MergeFilterQuery.cs
- RouteCollection.cs
- CornerRadius.cs
- ComplexTypeEmitter.cs
- GlyphRunDrawing.cs
- ActivitiesCollection.cs
- BitmapVisualManager.cs
- UnmanagedBitmapWrapper.cs
- EmptyReadOnlyDictionaryInternal.cs
- StringAnimationUsingKeyFrames.cs
- DesignerCategoryAttribute.cs
- ToolboxItemAttribute.cs
- PeerContact.cs
- Timeline.cs
- MetafileHeaderEmf.cs
- ObjectReaderCompiler.cs
- ButtonAutomationPeer.cs
- BinHexEncoder.cs
- MemberMaps.cs
- AsyncResult.cs
- SiteOfOriginContainer.cs
- UserUseLicenseDictionaryLoader.cs
- LinkArea.cs