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
- CardSpaceException.cs
- DurableDispatcherAddressingFault.cs
- InvalidStoreProtectionKeyException.cs
- RegexGroupCollection.cs
- RegexCaptureCollection.cs
- GridViewItemAutomationPeer.cs
- SafeHandle.cs
- DataGridViewUtilities.cs
- XmlDigitalSignatureProcessor.cs
- ServiceHostFactory.cs
- DecimalConverter.cs
- MsmqTransportElement.cs
- NullToBooleanConverter.cs
- DLinqAssociationProvider.cs
- FindSimilarActivitiesVerb.cs
- DataGridViewRow.cs
- RootBuilder.cs
- XmlElementCollection.cs
- OleDbMetaDataFactory.cs
- KnownBoxes.cs
- SHA384.cs
- WarningException.cs
- ZipIOExtraField.cs
- BaseValidator.cs
- NonClientArea.cs
- AttributeConverter.cs
- LicenseContext.cs
- VirtualPathExtension.cs
- CryptoApi.cs
- FrameworkElementFactory.cs
- MarkupCompiler.cs
- HighContrastHelper.cs
- WindowsGraphics.cs
- WindowInteropHelper.cs
- ZipIOLocalFileBlock.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- ToolStripArrowRenderEventArgs.cs
- DataGridColumnCollection.cs
- EncryptedKey.cs
- DesignerActionTextItem.cs
- FileFormatException.cs
- ObjectHandle.cs
- Command.cs
- RouteItem.cs
- GridViewRowCollection.cs
- ClassicBorderDecorator.cs
- XmlSerializerSection.cs
- InvariantComparer.cs
- ServiceBusyException.cs
- BamlLocalizationDictionary.cs
- GacUtil.cs
- ConstructorNeedsTagAttribute.cs
- ListViewHitTestInfo.cs
- PromptBuilder.cs
- SoapEnumAttribute.cs
- SqlUserDefinedAggregateAttribute.cs
- UnsafeNativeMethods.cs
- TextElementAutomationPeer.cs
- ParameterToken.cs
- NumberFormatInfo.cs
- ECDsa.cs
- FormViewModeEventArgs.cs
- XmlSchemaSequence.cs
- COM2IPerPropertyBrowsingHandler.cs
- HttpDictionary.cs
- ListControl.cs
- SymbolMethod.cs
- ScaleTransform3D.cs
- FrameworkContentElement.cs
- XmlAttribute.cs
- GlyphingCache.cs
- ContractComponent.cs
- DataGridViewButtonCell.cs
- Mappings.cs
- Debug.cs
- TextElementCollectionHelper.cs
- ToolStripSplitButton.cs
- UnsafeNativeMethods.cs
- XpsSerializationManagerAsync.cs
- SyndicationElementExtension.cs
- HelpEvent.cs
- QilChoice.cs
- ImageListImageEditor.cs
- MexHttpBindingCollectionElement.cs
- Interop.cs
- Hex.cs
- EntityDataSourceDataSelection.cs
- ExpressionBinding.cs
- EncodingNLS.cs
- TextOptions.cs
- SingleStorage.cs
- DatatypeImplementation.cs
- XsdDateTime.cs
- ValidationErrorCollection.cs
- SystemWebCachingSectionGroup.cs
- BuildProvider.cs
- OleDbErrorCollection.cs
- Wildcard.cs
- IApplicationTrustManager.cs
- sapiproxy.cs