Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / Metadata / ModelPerspective.cs / 1 / 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
- UrlMappingCollection.cs
- WindowsFormsSynchronizationContext.cs
- DateTimePicker.cs
- HebrewCalendar.cs
- StorageAssociationTypeMapping.cs
- HashHelper.cs
- RecognizeCompletedEventArgs.cs
- ProcessInfo.cs
- GridViewCommandEventArgs.cs
- ExpandCollapseProviderWrapper.cs
- SelectedDatesCollection.cs
- XmlNotation.cs
- DrawingDrawingContext.cs
- DataAccessException.cs
- LicFileLicenseProvider.cs
- OptionalColumn.cs
- CollectionEditor.cs
- UInt32.cs
- _AutoWebProxyScriptHelper.cs
- OperatingSystem.cs
- VectorAnimation.cs
- AlgoModule.cs
- NameObjectCollectionBase.cs
- ManualWorkflowSchedulerService.cs
- DiscoveryClientOutputChannel.cs
- ExpandSegmentCollection.cs
- BookmarkEventArgs.cs
- DataObjectPastingEventArgs.cs
- XmlSiteMapProvider.cs
- UIElement3DAutomationPeer.cs
- SystemKeyConverter.cs
- AnonymousIdentificationSection.cs
- XPathBinder.cs
- TransformConverter.cs
- DefaultHttpHandler.cs
- RootContext.cs
- HttpCookiesSection.cs
- BaseValidator.cs
- VisualCollection.cs
- GridViewSortEventArgs.cs
- Matrix.cs
- DataSvcMapFile.cs
- NullToBooleanConverter.cs
- DataRowChangeEvent.cs
- SimpleType.cs
- BindingObserver.cs
- ValueOfAction.cs
- IndentTextWriter.cs
- RoutedEventHandlerInfo.cs
- ServiceDocumentFormatter.cs
- PropertyMetadata.cs
- SafeNativeMethods.cs
- XmlCountingReader.cs
- ProtectedConfigurationProviderCollection.cs
- OutOfProcStateClientManager.cs
- XmlSchemaProviderAttribute.cs
- WebServiceResponse.cs
- VisualStateChangedEventArgs.cs
- QueryValue.cs
- Unit.cs
- DrawingGroup.cs
- SaveFileDialog.cs
- HttpRequestTraceRecord.cs
- TypeInfo.cs
- URLIdentityPermission.cs
- FlowDocumentPage.cs
- XmlUnspecifiedAttribute.cs
- OleAutBinder.cs
- WebBrowser.cs
- IndexedString.cs
- ConfigurationProperty.cs
- OleStrCAMarshaler.cs
- HierarchicalDataBoundControl.cs
- FacetValues.cs
- FunctionGenerator.cs
- XhtmlConformanceSection.cs
- DataGridRow.cs
- FixedTextContainer.cs
- DiscreteKeyFrames.cs
- UDPClient.cs
- MeasureData.cs
- CodeDirectoryCompiler.cs
- RootProfilePropertySettingsCollection.cs
- WebPartDescriptionCollection.cs
- SamlEvidence.cs
- PostBackOptions.cs
- XpsSerializationException.cs
- ProfileManager.cs
- cache.cs
- TemplateControl.cs
- RtfToken.cs
- VisualStyleElement.cs
- SqlDataRecord.cs
- NonParentingControl.cs
- SystemException.cs
- SoundPlayerAction.cs
- FormViewUpdateEventArgs.cs
- FieldAccessException.cs
- WorkflowEnvironment.cs
- ISO2022Encoding.cs