Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / EntityModel / SchemaObjectModel / ReturnType.cs / 2 / ReturnType.cs
using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Diagnostics; using System.Globalization; using System.Xml; using System.Xml.Schema; using System.Data; using System.IO; using System.Data.Metadata.Edm; using System.Data.Entity; namespace System.Data.EntityModel.SchemaObjectModel { class ReturnType : FacetEnabledSchemaElement { #region constructor ////// /// /// internal ReturnType(Function parentElement) : base(parentElement) { _typeUsageBuilder = new TypeUsageBuilder(this); } #endregion internal override SchemaElement Clone(SchemaElement parentElement) { ReturnType parameter = new ReturnType((Function)parentElement); parameter._type = _type; parameter.Name = this.Name; parameter._typeUsageBuilder = this._typeUsageBuilder; parameter._unresolvedType = this._unresolvedType; return parameter; } protected override bool HandleAttribute(XmlReader reader) { if (base.HandleAttribute(reader)) { return true; } else if (CanHandleAttribute(reader, XmlConstants.TypeElement)) { HandleTypeAttribute(reader); return true; } return false; } #region Private Methods ////// /// /// private void HandleTypeAttribute(XmlReader reader) { Debug.Assert(reader != null); Debug.Assert(this._unresolvedType == null); string type; if (!Utils.GetString(Schema, reader, out type)) return; if (!Utils.ValidateDottedName(Schema, reader, type)) return; this.UnresolvedType = type; } #endregion internal override void ResolveTopLevelNames() { Debug.Assert(!this.ParentElement.IsFunctionImport, "FunctionImports have return type as an attribute, so we should NEVER see them here"); base.ResolveTopLevelNames(); if (Schema.ResolveTypeName(this, UnresolvedType, out _type)) { if (!(_type is ScalarType)) { if (Schema.DataModel != SchemaDataModelOption.ProviderManifestModel) { AddError(ErrorCode.FunctionWithNonScalarTypeNotSupported, EdmSchemaErrorSeverity.Error, this, System.Data.Entity.Strings.FunctionWithNonScalarTypeNotSupported(_type.FQName, this.FQName)); } else { AddError(ErrorCode.FunctionWithNonScalarTypeNotSupported, EdmSchemaErrorSeverity.Error, this, System.Data.Entity.Strings.FunctionWithNonEdmTypeNotSupported(_type.FQName, this.FQName)); } } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Diagnostics; using System.Globalization; using System.Xml; using System.Xml.Schema; using System.Data; using System.IO; using System.Data.Metadata.Edm; using System.Data.Entity; namespace System.Data.EntityModel.SchemaObjectModel { class ReturnType : FacetEnabledSchemaElement { #region constructor ////// /// /// internal ReturnType(Function parentElement) : base(parentElement) { _typeUsageBuilder = new TypeUsageBuilder(this); } #endregion internal override SchemaElement Clone(SchemaElement parentElement) { ReturnType parameter = new ReturnType((Function)parentElement); parameter._type = _type; parameter.Name = this.Name; parameter._typeUsageBuilder = this._typeUsageBuilder; parameter._unresolvedType = this._unresolvedType; return parameter; } protected override bool HandleAttribute(XmlReader reader) { if (base.HandleAttribute(reader)) { return true; } else if (CanHandleAttribute(reader, XmlConstants.TypeElement)) { HandleTypeAttribute(reader); return true; } return false; } #region Private Methods ////// /// /// private void HandleTypeAttribute(XmlReader reader) { Debug.Assert(reader != null); Debug.Assert(this._unresolvedType == null); string type; if (!Utils.GetString(Schema, reader, out type)) return; if (!Utils.ValidateDottedName(Schema, reader, type)) return; this.UnresolvedType = type; } #endregion internal override void ResolveTopLevelNames() { Debug.Assert(!this.ParentElement.IsFunctionImport, "FunctionImports have return type as an attribute, so we should NEVER see them here"); base.ResolveTopLevelNames(); if (Schema.ResolveTypeName(this, UnresolvedType, out _type)) { if (!(_type is ScalarType)) { if (Schema.DataModel != SchemaDataModelOption.ProviderManifestModel) { AddError(ErrorCode.FunctionWithNonScalarTypeNotSupported, EdmSchemaErrorSeverity.Error, this, System.Data.Entity.Strings.FunctionWithNonScalarTypeNotSupported(_type.FQName, this.FQName)); } else { AddError(ErrorCode.FunctionWithNonScalarTypeNotSupported, EdmSchemaErrorSeverity.Error, this, System.Data.Entity.Strings.FunctionWithNonEdmTypeNotSupported(_type.FQName, this.FQName)); } } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- OdbcParameter.cs
- SimpleNameService.cs
- ArithmeticLiteral.cs
- SystemMulticastIPAddressInformation.cs
- EntityDataSourceDataSelectionPanel.designer.cs
- DataControlField.cs
- TextDecorationCollection.cs
- RuleSetCollection.cs
- HandleExceptionArgs.cs
- IdentityModelDictionary.cs
- SpecialNameAttribute.cs
- WinFormsComponentEditor.cs
- IdleTimeoutMonitor.cs
- BitHelper.cs
- ComPlusInstanceProvider.cs
- SamlAdvice.cs
- TranslateTransform.cs
- DefaultValueConverter.cs
- TypeConstant.cs
- AddInActivator.cs
- CmsUtils.cs
- GetWinFXPath.cs
- FacetChecker.cs
- XmlNode.cs
- webclient.cs
- HtmlTernaryTree.cs
- FilterElement.cs
- UndoUnit.cs
- SymmetricKeyWrap.cs
- TargetInvocationException.cs
- ObjectView.cs
- HttpFileCollectionWrapper.cs
- LoginDesigner.cs
- SymmetricKeyWrap.cs
- ObjectParameterCollection.cs
- RemotingClientProxy.cs
- LinqDataSourceView.cs
- StringResourceManager.cs
- MissingMemberException.cs
- MemberRelationshipService.cs
- InteropBitmapSource.cs
- Int16AnimationBase.cs
- DesignerCategoryAttribute.cs
- OdbcDataAdapter.cs
- ISO2022Encoding.cs
- EventProviderWriter.cs
- InternalBase.cs
- HelloOperation11AsyncResult.cs
- SqlConnectionPoolGroupProviderInfo.cs
- DefaultTraceListener.cs
- MobileSysDescriptionAttribute.cs
- XPathSelfQuery.cs
- DragDropHelper.cs
- VisualStyleRenderer.cs
- XmlMemberMapping.cs
- PriorityBinding.cs
- PriorityRange.cs
- NetSectionGroup.cs
- CodeSpit.cs
- ProgressPage.cs
- DispatcherObject.cs
- EntityProviderServices.cs
- ManipulationInertiaStartingEventArgs.cs
- SrgsNameValueTag.cs
- DataGridViewCheckBoxColumn.cs
- SettingsBindableAttribute.cs
- Shape.cs
- ByteRangeDownloader.cs
- TabPanel.cs
- EnumConverter.cs
- DataControlCommands.cs
- CompilationUtil.cs
- TableDetailsRow.cs
- PrintDialog.cs
- WebServiceClientProxyGenerator.cs
- CategoryEditor.cs
- EntityCommandCompilationException.cs
- DrawingBrush.cs
- httpserverutility.cs
- XmlCDATASection.cs
- MultipleViewProviderWrapper.cs
- SemanticBasicElement.cs
- SubclassTypeValidator.cs
- EventTrigger.cs
- TextRangeProviderWrapper.cs
- WebBrowserEvent.cs
- NavigationService.cs
- ProcessProtocolHandler.cs
- WebPartConnectionsConfigureVerb.cs
- OracleParameterBinding.cs
- TreeNodeBindingDepthConverter.cs
- _NegoState.cs
- TextElementAutomationPeer.cs
- TileBrush.cs
- mediaeventshelper.cs
- NameValueFileSectionHandler.cs
- GridViewDeleteEventArgs.cs
- BeginEvent.cs
- GenericTextProperties.cs
- InvalidFilterCriteriaException.cs