Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / Metadata / ModelPerspective.cs / 3 / ModelPerspective.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....], [....]
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
{
using System.Collections.Generic;
using System.Globalization;
///
/// Internal helper class for query
///
internal class ModelPerspective : Perspective
{
#region Contructors
///
/// Creates a new instance of perspective class so that query can work
/// ignorant of all spaces
///
/// runtime metadata container
internal ModelPerspective(MetadataWorkspace metadataWorkspace)
: base(metadataWorkspace, DataSpace.CSpace)
{
}
#endregion
#region Methods
///
/// Look up a type in the target data space based upon the fullName
///
/// fullName
/// true for case-insensitive lookup
/// The type usage object to return
/// True if the retrieval succeeded
internal override bool TryGetTypeByName(string fullName, bool ignoreCase, out TypeUsage typeUsage )
{
EntityUtil.CheckStringArgument(fullName, "fullName");
typeUsage = null;
EdmType edmType = null;
if (this.MetadataWorkspace.TryGetItem(fullName, ignoreCase, this.TargetDataspace, out edmType))
{
if (Helper.IsPrimitiveType(edmType))
{
typeUsage = this.MetadataWorkspace.GetCanonicalModelTypeUsage(((PrimitiveType)edmType).PrimitiveTypeKind);
}
else
{
typeUsage = TypeUsage.Create(edmType);
}
}
return typeUsage != null;
}
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....], [....]
//---------------------------------------------------------------------
namespace System.Data.Metadata.Edm
{
using System.Collections.Generic;
using System.Globalization;
///
/// Internal helper class for query
///
internal class ModelPerspective : Perspective
{
#region Contructors
///
/// Creates a new instance of perspective class so that query can work
/// ignorant of all spaces
///
/// runtime metadata container
internal ModelPerspective(MetadataWorkspace metadataWorkspace)
: base(metadataWorkspace, DataSpace.CSpace)
{
}
#endregion
#region Methods
///
/// Look up a type in the target data space based upon the fullName
///
/// fullName
/// true for case-insensitive lookup
/// The type usage object to return
/// True if the retrieval succeeded
internal override bool TryGetTypeByName(string fullName, bool ignoreCase, out TypeUsage typeUsage )
{
EntityUtil.CheckStringArgument(fullName, "fullName");
typeUsage = null;
EdmType edmType = null;
if (this.MetadataWorkspace.TryGetItem(fullName, ignoreCase, this.TargetDataspace, out edmType))
{
if (Helper.IsPrimitiveType(edmType))
{
typeUsage = this.MetadataWorkspace.GetCanonicalModelTypeUsage(((PrimitiveType)edmType).PrimitiveTypeKind);
}
else
{
typeUsage = TypeUsage.Create(edmType);
}
}
return typeUsage != null;
}
#endregion
}
}
// 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
- DynamicUpdateCommand.cs
- QuerySelectOp.cs
- ExpressionTextBoxAutomationPeer.cs
- Command.cs
- LongValidator.cs
- SqlTriggerAttribute.cs
- Shape.cs
- RelationalExpressions.cs
- UInt32Converter.cs
- DataViewManagerListItemTypeDescriptor.cs
- Stylus.cs
- DateTimeOffsetStorage.cs
- Visual3D.cs
- ScriptingScriptResourceHandlerSection.cs
- CodeTypeParameter.cs
- PropertyTabAttribute.cs
- X509Certificate2Collection.cs
- GridViewRowPresenter.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- GeneratedCodeAttribute.cs
- ActivityStatusChangeEventArgs.cs
- FrameworkContentElement.cs
- BamlTreeUpdater.cs
- FixedDocumentPaginator.cs
- BufferedReadStream.cs
- SecurityBindingElement.cs
- NamedPipeTransportManager.cs
- StrongNameIdentityPermission.cs
- PenContexts.cs
- ReliabilityContractAttribute.cs
- ClientOptions.cs
- SupportingTokenAuthenticatorSpecification.cs
- Geometry3D.cs
- SessionStateContainer.cs
- TextSearch.cs
- CqlLexer.cs
- SourceFileBuildProvider.cs
- CancellableEnumerable.cs
- SqlColumnizer.cs
- ScriptRegistrationManager.cs
- BrushConverter.cs
- OptimisticConcurrencyException.cs
- TabRenderer.cs
- TemplateParser.cs
- SiteMapDataSourceView.cs
- DecimalStorage.cs
- TdsParser.cs
- SByteStorage.cs
- SqlRowUpdatingEvent.cs
- AsyncResult.cs
- SimpleWebHandlerParser.cs
- AbstractSvcMapFileLoader.cs
- FileLevelControlBuilderAttribute.cs
- FileUtil.cs
- BooleanFacetDescriptionElement.cs
- FactoryId.cs
- DeploymentExceptionMapper.cs
- XPathDocumentIterator.cs
- SmtpCommands.cs
- RegistrationServices.cs
- StrongNamePublicKeyBlob.cs
- WizardPanelChangingEventArgs.cs
- VisualStyleElement.cs
- ClusterRegistryConfigurationProvider.cs
- XmlSchemaChoice.cs
- XPathException.cs
- DictionaryManager.cs
- Int32RectConverter.cs
- CodeSnippetTypeMember.cs
- SortedSetDebugView.cs
- Rect3DConverter.cs
- AsyncCallback.cs
- DynamicValueConverter.cs
- xsdvalidator.cs
- QuotedPrintableStream.cs
- LocalFileSettingsProvider.cs
- AutoCompleteStringCollection.cs
- WindowsTokenRoleProvider.cs
- MediaElementAutomationPeer.cs
- SchemaElement.cs
- Calendar.cs
- QilNode.cs
- followingsibling.cs
- FormViewDeletedEventArgs.cs
- SafeSecurityHandles.cs
- FreezableCollection.cs
- BufferedReceiveElement.cs
- ServiceModelExtensionCollectionElement.cs
- RotateTransform.cs
- mediaeventshelper.cs
- SQLString.cs
- InvalidStoreProtectionKeyException.cs
- DataGridViewLinkColumn.cs
- DesignOnlyAttribute.cs
- AlignmentXValidation.cs
- CodeSnippetExpression.cs
- LateBoundBitmapDecoder.cs
- DesignerAttribute.cs
- DecimalFormatter.cs
- SetterBaseCollection.cs