Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / EntityModel / SchemaObjectModel / FacetEnabledSchemaElement.cs / 1305376 / FacetEnabledSchemaElement.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.Metadata.Edm; using System.Diagnostics; using System.Xml; namespace System.Data.EntityModel.SchemaObjectModel { abstract class FacetEnabledSchemaElement : SchemaElement { protected SchemaType _type = null; protected string _unresolvedType = null; protected TypeUsageBuilder _typeUsageBuilder; #region public properties internal new Function ParentElement { get { return base.ParentElement as Function; } } internal SchemaType Type { get { return _type; } } internal virtual TypeUsage TypeUsage { get { return _typeUsageBuilder.TypeUsage; } } internal bool HasUserDefinedFacets { get { return _typeUsageBuilder.HasUserDefinedFacets; } } #endregion #region Internal Properties internal string UnresolvedType { get { return _unresolvedType; } set { _unresolvedType = value; } } #endregion #region Public Methods ////// /// /// internal FacetEnabledSchemaElement(Function parentElement) : base(parentElement) { } internal FacetEnabledSchemaElement(SchemaElement parentElement) : base(parentElement) { } #endregion #region Internal Methods internal override void ResolveTopLevelNames() { base.ResolveTopLevelNames(); Debug.Assert(this.Type == null, "This must be resolved exactly once"); if (Schema.ResolveTypeName(this, UnresolvedType, out _type)) { if (!(_type is ScalarType) && Schema.DataModel != SchemaDataModelOption.EntityDataModel) { AddError(ErrorCode.FunctionWithNonScalarTypeNotSupported, EdmSchemaErrorSeverity.Error, this, System.Data.Entity.Strings.FunctionWithNonScalarTypeNotSupported(_type.FQName, this.ParentElement.FQName)); return; } if (Schema.DataModel == SchemaDataModelOption.ProviderManifestModel && _typeUsageBuilder.HasUserDefinedFacets) { bool isInProviderManifest = Schema.DataModel == SchemaDataModelOption.ProviderManifestModel; _typeUsageBuilder.ValidateAndSetTypeUsage((ScalarType)_type, !isInProviderManifest); } } } internal void ValidateAndSetTypeUsage(ScalarType scalar) { _typeUsageBuilder.ValidateAndSetTypeUsage(scalar, false); } #endregion protected override bool HandleAttribute(XmlReader reader) { if (base.HandleAttribute(reader)) { return true; } else if (_typeUsageBuilder.HandleAttribute(reader)) { return true; } return false; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ObjectViewFactory.cs
- StateFinalizationDesigner.cs
- ConfigXmlSignificantWhitespace.cs
- Label.cs
- DynamicControl.cs
- EntityClassGenerator.cs
- TreeViewHitTestInfo.cs
- XsltInput.cs
- configsystem.cs
- DataGridViewControlCollection.cs
- UriTemplateVariableQueryValue.cs
- SimpleColumnProvider.cs
- ToolStripGripRenderEventArgs.cs
- ApplicationBuildProvider.cs
- StrongNameMembershipCondition.cs
- ProfilePropertyNameValidator.cs
- DateRangeEvent.cs
- RefExpr.cs
- ListCollectionView.cs
- KeyedHashAlgorithm.cs
- MediaElementAutomationPeer.cs
- CodeAccessSecurityEngine.cs
- VisualTarget.cs
- ApplicationBuildProvider.cs
- BinaryMethodMessage.cs
- WebServiceMethodData.cs
- Main.cs
- DbTypeMap.cs
- WindowsSecurityToken.cs
- ToolStrip.cs
- AutomationPatternInfo.cs
- RepeatInfo.cs
- RegexMatch.cs
- UserControl.cs
- HttpHostedTransportConfiguration.cs
- WebPartMovingEventArgs.cs
- StrokeNodeOperations2.cs
- ScriptReferenceBase.cs
- EmbossBitmapEffect.cs
- ApplicationProxyInternal.cs
- IdleTimeoutMonitor.cs
- CompilerError.cs
- JsonXmlDataContract.cs
- MsmqUri.cs
- HwndSourceKeyboardInputSite.cs
- DesigntimeLicenseContext.cs
- PngBitmapDecoder.cs
- ToolBarButton.cs
- TCPListener.cs
- WebPartTransformerAttribute.cs
- PropertyCollection.cs
- TypeHelpers.cs
- ZipIOExtraFieldZip64Element.cs
- Selection.cs
- UriWriter.cs
- SecurityContext.cs
- GACIdentityPermission.cs
- SoapCodeExporter.cs
- ModelFactory.cs
- SetterBaseCollection.cs
- TypeValidationEventArgs.cs
- ExpandCollapseProviderWrapper.cs
- Buffer.cs
- RequiredFieldValidator.cs
- DocumentXmlWriter.cs
- ValidationErrorEventArgs.cs
- TickBar.cs
- NTAccount.cs
- SchemaImporterExtensionElementCollection.cs
- MatrixAnimationUsingPath.cs
- ISFClipboardData.cs
- XmlIterators.cs
- AmbientProperties.cs
- dataprotectionpermission.cs
- HttpWebRequest.cs
- XNodeValidator.cs
- MailBnfHelper.cs
- CompilerState.cs
- Selector.cs
- HighlightComponent.cs
- LineServicesCallbacks.cs
- MsdtcClusterUtils.cs
- Viewport2DVisual3D.cs
- DataFormats.cs
- HopperCache.cs
- OleDbPermission.cs
- XmlSchemaParticle.cs
- EdgeModeValidation.cs
- MetadataHelper.cs
- Metafile.cs
- TypeDescriptionProviderAttribute.cs
- QueryParameter.cs
- ProvideValueServiceProvider.cs
- IndentedWriter.cs
- HwndSourceParameters.cs
- SearchForVirtualItemEventArgs.cs
- peernodestatemanager.cs
- CultureInfoConverter.cs
- KeyPullup.cs
- FontNameConverter.cs