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
- ClientScriptItemCollection.cs
- OleDbMetaDataFactory.cs
- ReflectPropertyDescriptor.cs
- PropertyRecord.cs
- X509CertificateStore.cs
- DockPanel.cs
- CompatibleIComparer.cs
- PropertyTab.cs
- NonSerializedAttribute.cs
- HttpClientCertificate.cs
- XmlQualifiedNameTest.cs
- Compress.cs
- SolidColorBrush.cs
- SourceLineInfo.cs
- Slider.cs
- Int64Converter.cs
- IPCCacheManager.cs
- StackBuilderSink.cs
- AtomMaterializerLog.cs
- NativeMethods.cs
- RawStylusSystemGestureInputReport.cs
- TypeConverterValueSerializer.cs
- DataGridTableCollection.cs
- ExportException.cs
- EmissiveMaterial.cs
- Frame.cs
- COM2PropertyDescriptor.cs
- NamespaceDecl.cs
- EventLogTraceListener.cs
- GridViewSelectEventArgs.cs
- InvalidDataContractException.cs
- DbUpdateCommandTree.cs
- IConvertible.cs
- Query.cs
- WebSysDescriptionAttribute.cs
- MergePropertyDescriptor.cs
- EpmAttributeNameBuilder.cs
- WindowsSpinner.cs
- IntPtr.cs
- AssemblyBuilder.cs
- Symbol.cs
- FontCacheLogic.cs
- HttpPostLocalhostServerProtocol.cs
- TextTreeRootNode.cs
- ObjectIDGenerator.cs
- QilStrConcatenator.cs
- DataSourceView.cs
- ObjectHandle.cs
- TextEditorContextMenu.cs
- WsatTransactionInfo.cs
- SocketInformation.cs
- Page.cs
- MethodToken.cs
- PeerPresenceInfo.cs
- SiteMap.cs
- XsltCompileContext.cs
- httpserverutility.cs
- PathData.cs
- ProtectedConfiguration.cs
- CoTaskMemHandle.cs
- HttpClientChannel.cs
- DomNameTable.cs
- PropertyReference.cs
- RegexWriter.cs
- _AcceptOverlappedAsyncResult.cs
- MultipartContentParser.cs
- QuadraticBezierSegment.cs
- QuadTree.cs
- PolyQuadraticBezierSegment.cs
- PolicyLevel.cs
- TypographyProperties.cs
- ReferentialConstraintRoleElement.cs
- X509AsymmetricSecurityKey.cs
- XmlDataProvider.cs
- IListConverters.cs
- CommandField.cs
- IItemProperties.cs
- SettingsPropertyValueCollection.cs
- XmlPreloadedResolver.cs
- CodeDirectiveCollection.cs
- HttpProcessUtility.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- LinkClickEvent.cs
- TextWriter.cs
- UnsafeNativeMethodsPenimc.cs
- ObjectToModelValueConverter.cs
- HtmlTitle.cs
- PackWebResponse.cs
- DataKeyCollection.cs
- ComponentEditorForm.cs
- QueryOptionExpression.cs
- StylusButtonEventArgs.cs
- XmlSerializerFactory.cs
- Sql8ConformanceChecker.cs
- AssemblyFilter.cs
- CodeParameterDeclarationExpressionCollection.cs
- BrowserCapabilitiesCodeGenerator.cs
- linebase.cs
- PasswordRecoveryAutoFormat.cs
- FilteredSchemaElementLookUpTable.cs