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
- TreeViewImageKeyConverter.cs
- ThreadStaticAttribute.cs
- EmptyImpersonationContext.cs
- AspNetHostingPermission.cs
- SqlInternalConnectionTds.cs
- ActivityDefaults.cs
- Queue.cs
- QuotedPrintableStream.cs
- FileDialog_Vista.cs
- SystemIcmpV6Statistics.cs
- EncodingInfo.cs
- ItemsControlAutomationPeer.cs
- BinaryFormatter.cs
- IApplicationTrustManager.cs
- RowToParametersTransformer.cs
- XPathException.cs
- StrongNameHelpers.cs
- ChangePasswordDesigner.cs
- Activator.cs
- WmlPanelAdapter.cs
- InputScope.cs
- SqlStatistics.cs
- BindToObject.cs
- DocumentScope.cs
- Simplifier.cs
- securitycriticaldataClass.cs
- _KerberosClient.cs
- Win32Native.cs
- PhysicalOps.cs
- CryptoKeySecurity.cs
- CornerRadiusConverter.cs
- RequestCacheEntry.cs
- FixedSOMLineRanges.cs
- CaseKeyBox.xaml.cs
- FlowNode.cs
- LoadRetryStrategyFactory.cs
- InternalConfigHost.cs
- ApplicationFileCodeDomTreeGenerator.cs
- NegotiateStream.cs
- SHA256Managed.cs
- ScrollProperties.cs
- CachedCompositeFamily.cs
- ModelTreeEnumerator.cs
- XmlCharCheckingWriter.cs
- ClockController.cs
- ScrollChangedEventArgs.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- DropSource.cs
- ValuePatternIdentifiers.cs
- SecurityProtocolCorrelationState.cs
- HtmlButton.cs
- ReadOnlyAttribute.cs
- Merger.cs
- BitArray.cs
- EventLog.cs
- AcceptorSessionSymmetricTransportSecurityProtocol.cs
- ExpandSegment.cs
- ViewLoader.cs
- ManagedCodeMarkers.cs
- XmlTextWriter.cs
- SchemaLookupTable.cs
- DateTimeEditor.cs
- PermissionToken.cs
- MarkerProperties.cs
- BinarySerializer.cs
- DesignTimeParseData.cs
- Propagator.JoinPropagator.cs
- GridViewColumn.cs
- MemberDescriptor.cs
- recordstatefactory.cs
- GuidelineCollection.cs
- ImportContext.cs
- AnchoredBlock.cs
- Point3DCollectionValueSerializer.cs
- ResourceIDHelper.cs
- OperationAbortedException.cs
- PassportIdentity.cs
- Unit.cs
- DataServiceQueryException.cs
- LogicalChannelCollection.cs
- EventArgs.cs
- ItemList.cs
- ResponseBodyWriter.cs
- SafeFileMappingHandle.cs
- BufferAllocator.cs
- WsiProfilesElementCollection.cs
- DefaultBinder.cs
- EntityDataSourceWrapperCollection.cs
- FlowPanelDesigner.cs
- UpdateManifestForBrowserApplication.cs
- MSHTMLHost.cs
- ProcessingInstructionAction.cs
- HierarchicalDataSourceIDConverter.cs
- SoapSchemaExporter.cs
- BindToObject.cs
- XmlAttributeAttribute.cs
- MultiplexingDispatchMessageFormatter.cs
- DataGridHelper.cs
- ViewStateModeByIdAttribute.cs
- DataServiceContext.cs