Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / Metadata / TargetPerspective.cs / 3 / TargetPerspective.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 TargetPerspective : Perspective { #region Constructors ////// Creates a new instance of perspective class so that query can work /// ignorant of all spaces /// /// runtime metadata container internal TargetPerspective(MetadataWorkspace metadataWorkspace) : base(metadataWorkspace, DataSpace.SSpace) { _modelPerspective = new ModelPerspective(metadataWorkspace); } #endregion #region Fields // TargetPerspective uses a ModelPerspective for a second lookup in type lookup private ModelPerspective _modelPerspective; #endregion #region Methods ////// Look up a type in the target data space based upon the fullName /// /// fullName /// true for case-insensitive lookup /// ///a list of types that have the specified full name but may differ by strong name internal override bool TryGetTypeByName(string fullName, bool ignoreCase, out TypeUsage usage) { EntityUtil.CheckStringArgument(fullName, "fullName"); EdmType edmType = null; if (this.MetadataWorkspace.TryGetItem(fullName, ignoreCase, this.TargetDataspace, out edmType)) { usage = TypeUsage.Create(edmType); usage = Helper.GetModelTypeUsage(usage); return true; } return _modelPerspective.TryGetTypeByName(fullName, ignoreCase, out usage); } /// /// Returns the entity container in CSpace or SSpace /// /// /// /// ///internal override bool TryGetEntityContainer(string name, bool ignoreCase, out EntityContainer entityContainer) { if (!base.TryGetEntityContainer(name, ignoreCase, out entityContainer)) { return _modelPerspective.TryGetEntityContainer(name, ignoreCase, out entityContainer); } return true; } #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 TargetPerspective : Perspective { #region Constructors ////// Creates a new instance of perspective class so that query can work /// ignorant of all spaces /// /// runtime metadata container internal TargetPerspective(MetadataWorkspace metadataWorkspace) : base(metadataWorkspace, DataSpace.SSpace) { _modelPerspective = new ModelPerspective(metadataWorkspace); } #endregion #region Fields // TargetPerspective uses a ModelPerspective for a second lookup in type lookup private ModelPerspective _modelPerspective; #endregion #region Methods ////// Look up a type in the target data space based upon the fullName /// /// fullName /// true for case-insensitive lookup /// ///a list of types that have the specified full name but may differ by strong name internal override bool TryGetTypeByName(string fullName, bool ignoreCase, out TypeUsage usage) { EntityUtil.CheckStringArgument(fullName, "fullName"); EdmType edmType = null; if (this.MetadataWorkspace.TryGetItem(fullName, ignoreCase, this.TargetDataspace, out edmType)) { usage = TypeUsage.Create(edmType); usage = Helper.GetModelTypeUsage(usage); return true; } return _modelPerspective.TryGetTypeByName(fullName, ignoreCase, out usage); } /// /// Returns the entity container in CSpace or SSpace /// /// /// /// ///internal override bool TryGetEntityContainer(string name, bool ignoreCase, out EntityContainer entityContainer) { if (!base.TryGetEntityContainer(name, ignoreCase, out entityContainer)) { return _modelPerspective.TryGetEntityContainer(name, ignoreCase, out entityContainer); } return true; } #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
- HwndSource.cs
- RelationshipDetailsRow.cs
- IisTraceWebEventProvider.cs
- ToolboxItemImageConverter.cs
- DesignerCategoryAttribute.cs
- mda.cs
- basecomparevalidator.cs
- DataGridViewLinkColumn.cs
- ClassData.cs
- EntityDataSourceViewSchema.cs
- SoapAttributes.cs
- WindowPattern.cs
- TextUtf8RawTextWriter.cs
- CompressStream.cs
- ToolStripLocationCancelEventArgs.cs
- ListBoxAutomationPeer.cs
- VideoDrawing.cs
- FontInfo.cs
- SqlConnection.cs
- WizardDesigner.cs
- Base64Stream.cs
- DbgUtil.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- BroadcastEventHelper.cs
- HttpCachePolicyWrapper.cs
- baseaxisquery.cs
- MdiWindowListStrip.cs
- ToolBar.cs
- PropertyCondition.cs
- AgileSafeNativeMemoryHandle.cs
- GeneratedContractType.cs
- WindowsFormsSectionHandler.cs
- ConnectionManagementElement.cs
- XhtmlBasicListAdapter.cs
- IntPtr.cs
- NamedPipeAppDomainProtocolHandler.cs
- ContainerControl.cs
- GroupDescription.cs
- XmlSchemaAll.cs
- StorageEntityTypeMapping.cs
- DataControlButton.cs
- GeneralTransform2DTo3DTo2D.cs
- SqlRowUpdatedEvent.cs
- GuidTagList.cs
- AsyncPostBackTrigger.cs
- NativeObjectSecurity.cs
- ItemCollection.cs
- ClientType.cs
- RequestNavigateEventArgs.cs
- SamlSecurityTokenAuthenticator.cs
- SerTrace.cs
- StandardTransformFactory.cs
- OleStrCAMarshaler.cs
- ComponentEditorForm.cs
- GenericEnumConverter.cs
- StaticSiteMapProvider.cs
- DocumentApplicationJournalEntry.cs
- CurrentChangedEventManager.cs
- RightsManagementEncryptedStream.cs
- DnsPermission.cs
- WebBrowserProgressChangedEventHandler.cs
- WaitForChangedResult.cs
- Funcletizer.cs
- BitmapCodecInfoInternal.cs
- DataGridTableCollection.cs
- HandoffBehavior.cs
- Regex.cs
- BufferedWebEventProvider.cs
- ListItemCollection.cs
- CreateBookmarkScope.cs
- PrintDocument.cs
- SingleAnimationUsingKeyFrames.cs
- _SslStream.cs
- DialogBaseForm.cs
- SimpleHandlerFactory.cs
- ObjRef.cs
- WebInvokeAttribute.cs
- StaticContext.cs
- NamedPipeProcessProtocolHandler.cs
- WorkflowServiceBehavior.cs
- ZoomPercentageConverter.cs
- ArraySubsetEnumerator.cs
- Vector3DAnimationBase.cs
- ThemeInfoAttribute.cs
- ForEachAction.cs
- RegexGroup.cs
- StorageEntitySetMapping.cs
- StructuralCache.cs
- DataControlImageButton.cs
- SecurityVerifiedMessage.cs
- SafeRegistryHandle.cs
- SchemaContext.cs
- VoiceInfo.cs
- FormatterServices.cs
- TreeView.cs
- MessageSecurityOverHttp.cs
- RIPEMD160Managed.cs
- IEnumerable.cs
- ZipIOModeEnforcingStream.cs
- IfAction.cs