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
- XmlWrappingReader.cs
- NavigationWindowAutomationPeer.cs
- TemplatedAdorner.cs
- PTProvider.cs
- FragmentQueryProcessor.cs
- ObjectRef.cs
- CacheChildrenQuery.cs
- FileVersionInfo.cs
- ExcludeFromCodeCoverageAttribute.cs
- CompositeKey.cs
- XmlSignatureProperties.cs
- DefaultAssemblyResolver.cs
- QilVisitor.cs
- PathGradientBrush.cs
- ThousandthOfEmRealPoints.cs
- Condition.cs
- infer.cs
- DateTimeConstantAttribute.cs
- TreeView.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- CreateUserWizard.cs
- CreateUserWizard.cs
- EpmSyndicationContentDeSerializer.cs
- DockingAttribute.cs
- itemelement.cs
- HtmlTable.cs
- GiveFeedbackEvent.cs
- SemanticValue.cs
- WebPartEditorApplyVerb.cs
- XmlIlVisitor.cs
- TextClipboardData.cs
- COAUTHIDENTITY.cs
- UriTemplateLiteralQueryValue.cs
- PointValueSerializer.cs
- ContextQuery.cs
- XmlnsDefinitionAttribute.cs
- CodeMemberMethod.cs
- EpmContentDeSerializer.cs
- KeyValuePair.cs
- ReflectionHelper.cs
- ServiceDescriptionImporter.cs
- EntityDataSourceConfigureObjectContext.cs
- BitmapEffectInputData.cs
- DuplexChannelBinder.cs
- DataGridTable.cs
- SizeConverter.cs
- ObfuscationAttribute.cs
- RemoteWebConfigurationHost.cs
- ProxyGenerator.cs
- FileDialogCustomPlacesCollection.cs
- ExpressionWriter.cs
- GeometryHitTestParameters.cs
- ScriptingAuthenticationServiceSection.cs
- Point4D.cs
- RangeValuePattern.cs
- HttpMethodConstraint.cs
- DataViewSetting.cs
- ILGenerator.cs
- TableHeaderCell.cs
- SqlBooleanMismatchVisitor.cs
- UIElementIsland.cs
- MemberPathMap.cs
- IItemContainerGenerator.cs
- CopyNamespacesAction.cs
- FixedNode.cs
- DragEvent.cs
- SourceInterpreter.cs
- WindowsFormsLinkLabel.cs
- WebPartDescription.cs
- SamlAuthorizationDecisionStatement.cs
- ListViewItemCollectionEditor.cs
- Visitor.cs
- UnsafeNativeMethods.cs
- BitmapEffectInput.cs
- ClientRequest.cs
- IPPacketInformation.cs
- DiscoveryMessageProperty.cs
- Helpers.cs
- ScrollEvent.cs
- WorkflowOwnershipException.cs
- XmlSchema.cs
- RegexRunnerFactory.cs
- FtpCachePolicyElement.cs
- InputScopeAttribute.cs
- DesignerView.xaml.cs
- EncryptedKey.cs
- LoginStatusDesigner.cs
- LoginView.cs
- ProxyHelper.cs
- SQlBooleanStorage.cs
- ConfigurationValidatorBase.cs
- XmlExceptionHelper.cs
- ValidationErrorCollection.cs
- DataGridViewBand.cs
- WmlTextViewAdapter.cs
- Message.cs
- DataGridViewCellPaintingEventArgs.cs
- FixedPageStructure.cs
- Composition.cs
- RowToFieldTransformer.cs