Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / MetadataPropertyAttribute.cs / 2 / MetadataPropertyAttribute.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....],[....]
//---------------------------------------------------------------------
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 [....],[....]
//---------------------------------------------------------------------
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
- SqlTriggerContext.cs
- UInt64Storage.cs
- documentation.cs
- TypeUsageBuilder.cs
- SendMessageContent.cs
- HtmlControlPersistable.cs
- AnnotationComponentManager.cs
- ItemsChangedEventArgs.cs
- ListenDesigner.cs
- ObjectRef.cs
- WindowsRichEdit.cs
- HostingEnvironmentSection.cs
- ReadOnlyDictionary.cs
- PathFigure.cs
- RegularExpressionValidator.cs
- VerticalAlignConverter.cs
- TextServicesLoader.cs
- ProviderConnectionPointCollection.cs
- MachineKey.cs
- RowUpdatingEventArgs.cs
- DataColumnPropertyDescriptor.cs
- FrameDimension.cs
- CalendarDateRange.cs
- WindowPatternIdentifiers.cs
- AttributeCollection.cs
- unsafeIndexingFilterStream.cs
- TypeElement.cs
- shaperfactory.cs
- Merger.cs
- FlowDocumentView.cs
- SHA1CryptoServiceProvider.cs
- EncryptedData.cs
- HtmlImage.cs
- SymmetricCryptoHandle.cs
- TemplateDefinition.cs
- KeyBinding.cs
- Stylesheet.cs
- IOException.cs
- GridViewColumnCollection.cs
- CommonGetThemePartSize.cs
- XmlStringTable.cs
- UTF32Encoding.cs
- TagPrefixCollection.cs
- PageThemeBuildProvider.cs
- CommandField.cs
- IntSecurity.cs
- ParameterBuilder.cs
- ProfilePropertySettingsCollection.cs
- HttpConfigurationSystem.cs
- XmlUtf8RawTextWriter.cs
- ManualResetEvent.cs
- VisualProxy.cs
- AssignDesigner.xaml.cs
- BooleanConverter.cs
- SupportingTokenProviderSpecification.cs
- SafeCryptoHandles.cs
- DbTransaction.cs
- ConfigurationElementCollection.cs
- BooleanAnimationBase.cs
- SecurityContextTokenCache.cs
- AudioBase.cs
- DataObjectMethodAttribute.cs
- X509CertificateCollection.cs
- LocalBuilder.cs
- SelectionUIHandler.cs
- RuleSettingsCollection.cs
- BitmapEffectDrawingContextWalker.cs
- ListBindableAttribute.cs
- GZipDecoder.cs
- SqlNode.cs
- Stackframe.cs
- LogStream.cs
- IImplicitResourceProvider.cs
- SerializationHelper.cs
- PersistChildrenAttribute.cs
- ReaderWriterLock.cs
- SqlDataSourceCache.cs
- FlowDocumentView.cs
- CustomErrorsSection.cs
- GZipDecoder.cs
- HttpServerChannel.cs
- MaskedTextProvider.cs
- Pkcs7Signer.cs
- StaticFileHandler.cs
- EntityTransaction.cs
- DesignerMetadata.cs
- BindingWorker.cs
- RedirectionProxy.cs
- figurelength.cs
- BitmapEffectInputData.cs
- RC2.cs
- FontFamilyValueSerializer.cs
- DBCommandBuilder.cs
- DataPagerFieldItem.cs
- BamlTreeNode.cs
- FontFamily.cs
- XmlLanguageConverter.cs
- DragDropManager.cs
- InstanceHandleReference.cs
- Selection.cs