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
- StaticFileHandler.cs
- OdbcFactory.cs
- BinaryWriter.cs
- XsdDateTime.cs
- ValidationError.cs
- EndPoint.cs
- MultiBindingExpression.cs
- MailDefinition.cs
- CatalogZoneBase.cs
- TimeIntervalCollection.cs
- TextWriter.cs
- DynamicRenderer.cs
- AnnotationElement.cs
- ProxySimple.cs
- RoleService.cs
- MobileSysDescriptionAttribute.cs
- DesignerForm.cs
- HandlerElement.cs
- PasswordTextContainer.cs
- NavigationProgressEventArgs.cs
- _LocalDataStore.cs
- ExpressionPrefixAttribute.cs
- SectionVisual.cs
- DataGridRowEventArgs.cs
- FileCodeGroup.cs
- NetNamedPipeBindingElement.cs
- EmbossBitmapEffect.cs
- LookupNode.cs
- BaseCodePageEncoding.cs
- ActiveXSite.cs
- Calendar.cs
- EntityDataSourceDesignerHelper.cs
- RectAnimationUsingKeyFrames.cs
- RSAPKCS1SignatureFormatter.cs
- httpserverutility.cs
- PropertyMapper.cs
- CodeDelegateInvokeExpression.cs
- DataSvcMapFileSerializer.cs
- BypassElement.cs
- RuntimeConfigLKG.cs
- MetadataArtifactLoader.cs
- SamlNameIdentifierClaimResource.cs
- WorkflowQueuingService.cs
- xamlnodes.cs
- ControlAdapter.cs
- EdmMember.cs
- COM2TypeInfoProcessor.cs
- ParseChildrenAsPropertiesAttribute.cs
- MissingMemberException.cs
- InstanceKeyView.cs
- SinglePageViewer.cs
- InternalPermissions.cs
- CollectionDataContractAttribute.cs
- NamedElement.cs
- ValidatedControlConverter.cs
- SoapUnknownHeader.cs
- InputMethodStateChangeEventArgs.cs
- GeometryConverter.cs
- AttributeXamlType.cs
- Stylus.cs
- PolyLineSegment.cs
- BitmapEffectGeneralTransform.cs
- SmiEventSink_Default.cs
- QuestionEventArgs.cs
- XPathParser.cs
- SqlUserDefinedTypeAttribute.cs
- QueryAsyncResult.cs
- PageWrapper.cs
- AdjustableArrowCap.cs
- StrokeRenderer.cs
- RevocationPoint.cs
- APCustomTypeDescriptor.cs
- SpeechSeg.cs
- SafeRegistryHandle.cs
- HtmlInputPassword.cs
- HashAlgorithm.cs
- Flowchart.cs
- BaseParser.cs
- ClassGenerator.cs
- MethodImplAttribute.cs
- ReferenceService.cs
- WsdlExporter.cs
- X509InitiatorCertificateClientElement.cs
- BufferedStream.cs
- AutoGeneratedFieldProperties.cs
- Thumb.cs
- ItemCollection.cs
- PersonalizationStateInfoCollection.cs
- XmlEventCache.cs
- DynamicILGenerator.cs
- GPRECTF.cs
- Rotation3DAnimationUsingKeyFrames.cs
- XmlSerializerFactory.cs
- TypeForwardedFromAttribute.cs
- DbCommandTree.cs
- PropertyEmitter.cs
- BindValidator.cs
- EventLogConfiguration.cs
- XmlIlTypeHelper.cs
- GridViewPageEventArgs.cs