Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataEntity / System / Data / EntityModel / SchemaObjectModel / ReturnType.cs / 1 / 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
- WindowsListViewGroupSubsetLink.cs
- SizeChangedEventArgs.cs
- OverflowException.cs
- ExpandoClass.cs
- SqlExpressionNullability.cs
- SecurityState.cs
- PreProcessor.cs
- Transform3D.cs
- COSERVERINFO.cs
- ConfigurationSettings.cs
- ViewStateException.cs
- _LocalDataStoreMgr.cs
- SelectionGlyph.cs
- PhonemeEventArgs.cs
- ErrorTableItemStyle.cs
- CaseInsensitiveHashCodeProvider.cs
- EncoderExceptionFallback.cs
- XmlSignificantWhitespace.cs
- EventArgs.cs
- DispatchChannelSink.cs
- StatusBarDrawItemEvent.cs
- TextDecorationLocationValidation.cs
- ScrollEventArgs.cs
- PassportIdentity.cs
- StateChangeEvent.cs
- EventMappingSettingsCollection.cs
- PropertyNames.cs
- AttributeEmitter.cs
- WindowsProgressbar.cs
- AudioLevelUpdatedEventArgs.cs
- HwndHostAutomationPeer.cs
- TextSpanModifier.cs
- CatalogPartCollection.cs
- DrawingContextDrawingContextWalker.cs
- StaticFileHandler.cs
- ZipIOCentralDirectoryBlock.cs
- SSmlParser.cs
- log.cs
- RadioButtonBaseAdapter.cs
- validation.cs
- BindingOperations.cs
- ClientScriptManagerWrapper.cs
- Atom10FormatterFactory.cs
- Atom10FormatterFactory.cs
- DrawListViewColumnHeaderEventArgs.cs
- CodeAttributeArgument.cs
- TypeBrowserDialog.cs
- SocketInformation.cs
- VerificationAttribute.cs
- TextParagraphProperties.cs
- AlphabeticalEnumConverter.cs
- GridViewEditEventArgs.cs
- ConstraintEnumerator.cs
- ValidationErrorCollection.cs
- X509SecurityToken.cs
- PaintValueEventArgs.cs
- PageCodeDomTreeGenerator.cs
- PopupRoot.cs
- CompositeCollectionView.cs
- SystemKeyConverter.cs
- ColumnHeaderCollectionEditor.cs
- unitconverter.cs
- AlphabeticalEnumConverter.cs
- DictionaryMarkupSerializer.cs
- XmlBufferReader.cs
- DataObjectEventArgs.cs
- MessagePropertyFilter.cs
- DesignerTransactionCloseEvent.cs
- SymbolPair.cs
- MetadataProperty.cs
- Boolean.cs
- WorkflowDispatchContext.cs
- AttributedMetaModel.cs
- WebPartConnection.cs
- WSFederationHttpBindingCollectionElement.cs
- SourceItem.cs
- TimeoutException.cs
- RtfControls.cs
- ScriptManagerProxy.cs
- SecurityIdentifierConverter.cs
- TextContainerHelper.cs
- MouseActionConverter.cs
- RequestTimeoutManager.cs
- HttpResponseBase.cs
- ReflectionUtil.cs
- HashHelper.cs
- DesignerActionUIStateChangeEventArgs.cs
- CompositeCollectionView.cs
- CodeArrayCreateExpression.cs
- VirtualDirectoryMapping.cs
- parserscommon.cs
- DynamicField.cs
- ReadOnlyObservableCollection.cs
- CommittableTransaction.cs
- TrustManagerMoreInformation.cs
- TextServicesPropertyRanges.cs
- AssemblyCache.cs
- WorkflowRuntimeServiceElementCollection.cs
- DesignTimeData.cs
- Int64KeyFrameCollection.cs