Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WarningException.cs
- PrimitiveDataContract.cs
- MatchAttribute.cs
- ResXResourceWriter.cs
- TypedElement.cs
- FusionWrap.cs
- VisualBrush.cs
- TreeNodeStyleCollection.cs
- Missing.cs
- ErrorStyle.cs
- EnumerableValidator.cs
- ButtonFieldBase.cs
- EqualityArray.cs
- SQLGuidStorage.cs
- EnterpriseServicesHelper.cs
- PageVisual.cs
- InputScopeManager.cs
- BamlWriter.cs
- SHA384Managed.cs
- Ref.cs
- EditorZoneBase.cs
- GC.cs
- Line.cs
- HttpRequestCacheValidator.cs
- sqlstateclientmanager.cs
- DataGridViewSelectedColumnCollection.cs
- ProxyBuilder.cs
- CaseInsensitiveOrdinalStringComparer.cs
- IPPacketInformation.cs
- CompensatableSequenceActivity.cs
- ComponentDispatcherThread.cs
- SerialPort.cs
- DocumentGridContextMenu.cs
- MediaPlayer.cs
- FormDesigner.cs
- FileRegion.cs
- GlobalProxySelection.cs
- VBIdentifierName.cs
- InstancePersistenceEvent.cs
- CodeMemberField.cs
- TextAutomationPeer.cs
- ArrayTypeMismatchException.cs
- TemplateManager.cs
- AssemblyBuilder.cs
- ContentFilePart.cs
- FixedTextBuilder.cs
- MimeBasePart.cs
- OuterGlowBitmapEffect.cs
- ClientConfigurationHost.cs
- DataRelationPropertyDescriptor.cs
- Popup.cs
- COM2PropertyPageUITypeConverter.cs
- XmlQueryType.cs
- DataKey.cs
- versioninfo.cs
- ReliableSessionElement.cs
- QueryContinueDragEvent.cs
- PartialTrustVisibleAssembliesSection.cs
- FolderLevelBuildProviderCollection.cs
- StorageTypeMapping.cs
- DataGridRow.cs
- AncestorChangedEventArgs.cs
- LineSegment.cs
- Size.cs
- ProcessHostServerConfig.cs
- BufferedReadStream.cs
- CallSiteHelpers.cs
- ProfileGroupSettings.cs
- TableLayoutStyleCollection.cs
- CompressStream.cs
- DataGridViewComboBoxCell.cs
- CodeAttributeArgumentCollection.cs
- TreeNode.cs
- SmtpException.cs
- SimpleHandlerBuildProvider.cs
- AutoResetEvent.cs
- QilGeneratorEnv.cs
- Typography.cs
- GraphicsContainer.cs
- assertwrapper.cs
- Internal.cs
- BitmapCodecInfoInternal.cs
- SecurityResources.cs
- ListViewEditEventArgs.cs
- ListViewItemMouseHoverEvent.cs
- CodeDirectionExpression.cs
- TextFormatterContext.cs
- FileVersionInfo.cs
- XmlDocumentType.cs
- BaseTreeIterator.cs
- DocumentsTrace.cs
- EventLogHandle.cs
- ScriptManager.cs
- SafeCryptoHandles.cs
- App.cs
- DuplicateWaitObjectException.cs
- MethodExpr.cs
- PreviewPrintController.cs
- _SafeNetHandles.cs
- PkcsMisc.cs