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
- SafePipeHandle.cs
- UnitySerializationHolder.cs
- WebRequestModulesSection.cs
- EntityDesignerDataSourceView.cs
- Attributes.cs
- EtwTrackingBehavior.cs
- RuntimeConfigurationRecord.cs
- AppSettings.cs
- Attributes.cs
- DockPatternIdentifiers.cs
- CultureMapper.cs
- ScaleTransform3D.cs
- DbConnectionStringBuilder.cs
- GetPageNumberCompletedEventArgs.cs
- SafeSecurityHelper.cs
- FixedSOMTableRow.cs
- SingleConverter.cs
- VerificationException.cs
- XmlBindingWorker.cs
- NullEntityWrapper.cs
- Odbc32.cs
- ApplicationTrust.cs
- RelationshipEndMember.cs
- _IPv4Address.cs
- StringSource.cs
- X509Chain.cs
- DateTimeConverter.cs
- XmlArrayAttribute.cs
- Constraint.cs
- SQLDoubleStorage.cs
- BitmapEffectInputConnector.cs
- NotificationContext.cs
- CharKeyFrameCollection.cs
- XamlToRtfParser.cs
- NativeMethods.cs
- Effect.cs
- ConstrainedDataObject.cs
- ResolveCriteriaApril2005.cs
- PipeSecurity.cs
- ModelPerspective.cs
- ObjectNotFoundException.cs
- StringDictionaryEditor.cs
- LockCookie.cs
- TextEditorContextMenu.cs
- InternalControlCollection.cs
- COM2IDispatchConverter.cs
- DeferrableContent.cs
- CellLabel.cs
- RangeBaseAutomationPeer.cs
- EpmCustomContentWriterNodeData.cs
- ParentControlDesigner.cs
- FixedTextSelectionProcessor.cs
- CodeSnippetTypeMember.cs
- WebCategoryAttribute.cs
- XamlToRtfParser.cs
- TaskbarItemInfo.cs
- DataGridCheckBoxColumn.cs
- XmlHierarchicalDataSourceView.cs
- WindowsSysHeader.cs
- MenuItem.cs
- RootAction.cs
- dataobject.cs
- StackBuilderSink.cs
- DLinqColumnProvider.cs
- _LocalDataStore.cs
- PropertyGrid.cs
- TabControl.cs
- XamlHostingSectionGroup.cs
- CacheVirtualItemsEvent.cs
- DataContractSerializerServiceBehavior.cs
- AutomationProperties.cs
- WithParamAction.cs
- FloatUtil.cs
- OuterGlowBitmapEffect.cs
- HostExecutionContextManager.cs
- ListDataHelper.cs
- InvalidDataException.cs
- SqlTriggerAttribute.cs
- IdentitySection.cs
- WaitForChangedResult.cs
- InstanceLockedException.cs
- DataGridColumn.cs
- LockedBorderGlyph.cs
- Selector.cs
- CompiledRegexRunnerFactory.cs
- DetailsViewDeletedEventArgs.cs
- ExpanderAutomationPeer.cs
- Dispatcher.cs
- XmlFormatExtensionAttribute.cs
- EarlyBoundInfo.cs
- _UriSyntax.cs
- TagMapInfo.cs
- PenContexts.cs
- CalendarDesigner.cs
- OutputScope.cs
- WebServiceResponseDesigner.cs
- RuleEngine.cs
- ToolStripItem.cs
- VisualTreeUtils.cs
- InternalBufferOverflowException.cs