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
- CRYPTPROTECT_PROMPTSTRUCT.cs
- WebContentFormatHelper.cs
- QueryExpression.cs
- CompiledQueryCacheKey.cs
- SqlUserDefinedAggregateAttribute.cs
- WebBrowsableAttribute.cs
- IndicCharClassifier.cs
- GACMembershipCondition.cs
- ProtocolViolationException.cs
- HtmlAnchor.cs
- SQLBytesStorage.cs
- WaitHandleCannotBeOpenedException.cs
- RawStylusActions.cs
- PriorityBinding.cs
- PropertyStore.cs
- AppSettingsExpressionBuilder.cs
- GACIdentityPermission.cs
- ZoneLinkButton.cs
- FileInfo.cs
- FilterableAttribute.cs
- WebPartZoneCollection.cs
- ZipPackagePart.cs
- VSWCFServiceContractGenerator.cs
- ILGenerator.cs
- SystemException.cs
- ItemChangedEventArgs.cs
- ImageSource.cs
- MimeMapping.cs
- FieldAccessException.cs
- NetPipeSection.cs
- HybridDictionary.cs
- ManagementEventArgs.cs
- QilBinary.cs
- EntityTypeEmitter.cs
- AdditionalEntityFunctions.cs
- StylesEditorDialog.cs
- RenderContext.cs
- BindValidator.cs
- EndGetFileNameFromUserRequest.cs
- DbProviderFactoriesConfigurationHandler.cs
- AsymmetricKeyExchangeDeformatter.cs
- SelectionList.cs
- FileDataSourceCache.cs
- SliderAutomationPeer.cs
- ExternalCalls.cs
- InputScopeConverter.cs
- NetworkCredential.cs
- SHA384Managed.cs
- ConfigXmlDocument.cs
- DiscoveryRequestHandler.cs
- SafeNativeMethods.cs
- FacetDescriptionElement.cs
- DBNull.cs
- _ConnectStream.cs
- CellCreator.cs
- AdornerPresentationContext.cs
- MD5CryptoServiceProvider.cs
- DataViewListener.cs
- EntityDataReader.cs
- SqlDependencyListener.cs
- RootNamespaceAttribute.cs
- QilNode.cs
- PositiveTimeSpanValidatorAttribute.cs
- DataSourceConverter.cs
- ContentType.cs
- TraceListener.cs
- cookiecollection.cs
- OutputWindow.cs
- BaseConfigurationRecord.cs
- HtmlInputText.cs
- CookieParameter.cs
- SessionIDManager.cs
- DataBoundControl.cs
- DataGridViewTextBoxCell.cs
- unsafenativemethodsother.cs
- SmtpReplyReader.cs
- AuthenticationManager.cs
- SubclassTypeValidatorAttribute.cs
- TemplateDefinition.cs
- Int32Rect.cs
- MsmqInputChannelListener.cs
- RectangleGeometry.cs
- SkewTransform.cs
- Single.cs
- XmlSchemaDocumentation.cs
- GridProviderWrapper.cs
- Configuration.cs
- DebuggerAttributes.cs
- LogRecordSequence.cs
- XmlDataCollection.cs
- StateDesigner.cs
- RewritingPass.cs
- TabControlEvent.cs
- ImageListImageEditor.cs
- Console.cs
- LogicalTreeHelper.cs
- TransactionBridge.cs
- DebuggerService.cs
- TextWriter.cs
- commandenforcer.cs