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 / TargetPerspective.cs / 1 / 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
- Event.cs
- ClientCultureInfo.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- ISAPIRuntime.cs
- StringStorage.cs
- FlowLayoutPanel.cs
- _NegotiateClient.cs
- RegisterInfo.cs
- StylusButton.cs
- IndentedTextWriter.cs
- WizardForm.cs
- SecurityElement.cs
- CodeGenerator.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- Thumb.cs
- GridViewPageEventArgs.cs
- AxImporter.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- DesignerActionItemCollection.cs
- HatchBrush.cs
- ClosableStream.cs
- XmlSchema.cs
- KeyboardNavigation.cs
- SocketConnection.cs
- EdmComplexPropertyAttribute.cs
- ClientConfigPaths.cs
- SoapReflectionImporter.cs
- TextParagraphView.cs
- AttributeUsageAttribute.cs
- WindowsTab.cs
- DateTimeParse.cs
- Misc.cs
- SqlRowUpdatingEvent.cs
- XmlDataDocument.cs
- TextTrailingCharacterEllipsis.cs
- AdapterDictionary.cs
- XPathScanner.cs
- Size.cs
- PropertyToken.cs
- PrintSystemException.cs
- WebControlsSection.cs
- CounterCreationDataCollection.cs
- SafeArrayTypeMismatchException.cs
- DbDeleteCommandTree.cs
- FixedHyperLink.cs
- FeatureManager.cs
- EditorZoneBase.cs
- HierarchicalDataSourceControl.cs
- DecoderNLS.cs
- PasswordRecovery.cs
- SymLanguageType.cs
- SafeArrayTypeMismatchException.cs
- HwndSourceParameters.cs
- IPipelineRuntime.cs
- ObjectDataSourceStatusEventArgs.cs
- Zone.cs
- ProtocolsSection.cs
- TypeDelegator.cs
- InputLanguageSource.cs
- VirtualPathData.cs
- EDesignUtil.cs
- RadioButtonFlatAdapter.cs
- DbProviderManifest.cs
- Point3DCollectionConverter.cs
- DataFormat.cs
- TextElementEnumerator.cs
- Compiler.cs
- PasswordBoxAutomationPeer.cs
- WeakReferenceKey.cs
- ScalarType.cs
- XmlEntity.cs
- BitmapFrame.cs
- HtmlValidationSummaryAdapter.cs
- ObjectListCommandEventArgs.cs
- SqlMethodAttribute.cs
- SiteMapNodeItemEventArgs.cs
- ListViewDeletedEventArgs.cs
- WindowsAuthenticationModule.cs
- MatchingStyle.cs
- BinaryObjectReader.cs
- IfJoinedCondition.cs
- HtmlHead.cs
- ConfigXmlText.cs
- PaintEvent.cs
- ProxyWebPartConnectionCollection.cs
- SqlDataSource.cs
- Int32.cs
- ProcessModule.cs
- BoolExpression.cs
- EdmItemError.cs
- DataSetSchema.cs
- Line.cs
- Set.cs
- SynchronizationContext.cs
- ComboBoxHelper.cs
- MbpInfo.cs
- WindowsAuthenticationModule.cs
- MapPathBasedVirtualPathProvider.cs
- VScrollBar.cs
- RenamedEventArgs.cs