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
- DecimalMinMaxAggregationOperator.cs
- ButtonPopupAdapter.cs
- TaiwanCalendar.cs
- SQLMembershipProvider.cs
- TCPListener.cs
- StringComparer.cs
- EntityViewGenerationAttribute.cs
- FontCacheUtil.cs
- HeaderedItemsControl.cs
- BasicExpressionVisitor.cs
- DbProviderSpecificTypePropertyAttribute.cs
- UserControlBuildProvider.cs
- HiddenFieldPageStatePersister.cs
- PartitionedStream.cs
- Scanner.cs
- MultipleViewPattern.cs
- Int32Converter.cs
- AtomicFile.cs
- MDIControlStrip.cs
- ServicePointManager.cs
- TextOnlyOutput.cs
- FormViewDeletedEventArgs.cs
- _NtlmClient.cs
- MimeObjectFactory.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- TextEndOfParagraph.cs
- LexicalChunk.cs
- IImplicitResourceProvider.cs
- XamlStream.cs
- XamlClipboardData.cs
- IncrementalCompileAnalyzer.cs
- InvokeMethodActivityDesigner.cs
- UTF32Encoding.cs
- SpellerHighlightLayer.cs
- RegexGroupCollection.cs
- ManagementInstaller.cs
- UserControl.cs
- DrawingServices.cs
- VectorCollectionValueSerializer.cs
- TypeTypeConverter.cs
- DbProviderServices.cs
- LinqExpressionNormalizer.cs
- ConfigurationElementCollection.cs
- WindowsEditBox.cs
- DLinqDataModelProvider.cs
- ApplicationId.cs
- VectorAnimationBase.cs
- WebServiceReceive.cs
- SecuritySessionSecurityTokenProvider.cs
- TraceLevelStore.cs
- Compress.cs
- UpDownEvent.cs
- ScriptControlDescriptor.cs
- loginstatus.cs
- Decoder.cs
- SendMessageChannelCache.cs
- UserPreference.cs
- Dictionary.cs
- SqlReorderer.cs
- ApplicationActivator.cs
- TableItemProviderWrapper.cs
- ValueUtilsSmi.cs
- _AuthenticationState.cs
- X509WindowsSecurityToken.cs
- TextTreeInsertUndoUnit.cs
- ToolStripItem.cs
- _AutoWebProxyScriptHelper.cs
- DbParameterCollectionHelper.cs
- SqlLiftIndependentRowExpressions.cs
- ItemsControlAutomationPeer.cs
- CompilerCollection.cs
- HostedTcpTransportManager.cs
- ScrollItemPatternIdentifiers.cs
- TdsParserSessionPool.cs
- AppDomain.cs
- UiaCoreProviderApi.cs
- HealthMonitoringSectionHelper.cs
- ColumnCollection.cs
- NativeStructs.cs
- Exceptions.cs
- FlowDocumentView.cs
- OptimalTextSource.cs
- FormsAuthenticationEventArgs.cs
- ByteFacetDescriptionElement.cs
- SqlCommand.cs
- OverflowException.cs
- FunctionNode.cs
- XmlNavigatorStack.cs
- UTF8Encoding.cs
- DataViewSetting.cs
- ColumnHeader.cs
- ProfileProvider.cs
- ButtonColumn.cs
- MaskedTextBoxDesigner.cs
- HtmlControl.cs
- DrawingContextFlattener.cs
- ListMarkerLine.cs
- CodeDOMProvider.cs
- BitmapSourceSafeMILHandle.cs
- SettingsAttributeDictionary.cs