Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / EntityModel / SchemaObjectModel / ReferenceTypeElement.cs / 1305376 / ReferenceTypeElement.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using Som = System.Data.EntityModel.SchemaObjectModel; 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; using System.Text; namespace System.Data.EntityModel.SchemaObjectModel { class ReferenceTypeElement : ModelFunctionTypeElement { #region constructor ////// /// /// internal ReferenceTypeElement(SchemaElement parentElement) : base(parentElement) { } #endregion protected override bool HandleAttribute(XmlReader reader) { if (base.HandleAttribute(reader)) { return true; } else if (CanHandleAttribute(reader, XmlConstants.TypeElement)) { HandleTypeElementAttribute(reader); return true; } return false; } protected void HandleTypeElementAttribute(XmlReader reader) { Debug.Assert(reader != null); string type; if (!Utils.GetString(Schema, reader, out type)) return; _unresolvedType = type; } internal override void WriteIdentity(StringBuilder builder) { Debug.Assert(UnresolvedType != null && !UnresolvedType.Trim().Equals(String.Empty)); builder.Append("Ref(" + UnresolvedType + ")"); } internal override TypeUsage GetTypeUsage() { return _typeUsage; } internal override bool ResolveNameAndSetTypeUsage(Converter.ConversionCache convertedItemCache, DictionarynewGlobalItems) { if (_typeUsage == null) { Debug.Assert(!(_type is ScalarType)); EdmType edmType = (EdmType)Converter.LoadSchemaElement(_type, _type.Schema.ProviderManifest, convertedItemCache, newGlobalItems); EntityType entityType = edmType as EntityType; Debug.Assert(entityType != null); RefType refType = new RefType(entityType); refType.AddMetadataProperties(this.OtherContent); _typeUsage = TypeUsage.Create(refType); } return true; } internal override void Validate() { base.Validate(); if (_type != null && !(_type is SchemaEntityType)) { //Ref type refers to non entity type AddError(ErrorCode.ReferenceToNonEntityType, EdmSchemaErrorSeverity.Error, Strings.ReferenceToNonEntityType(_type.FQName)); } } } } // 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
- WebPartVerbCollection.cs
- HtmlInputReset.cs
- XmlSchemas.cs
- CodeCatchClauseCollection.cs
- PtsCache.cs
- WmlLiteralTextAdapter.cs
- XmlReflectionImporter.cs
- SvcMapFile.cs
- SoapIncludeAttribute.cs
- BamlLocalizableResourceKey.cs
- PerspectiveCamera.cs
- XmlSchemaValidator.cs
- XmlSchemaAny.cs
- oledbmetadatacollectionnames.cs
- TextRunCache.cs
- Message.cs
- CurrentTimeZone.cs
- VisualBrush.cs
- CdpEqualityComparer.cs
- SqlTriggerAttribute.cs
- CompositeCollectionView.cs
- NameHandler.cs
- RecognitionResult.cs
- RemotingService.cs
- CodeAttributeArgumentCollection.cs
- UmAlQuraCalendar.cs
- MultiBinding.cs
- RemotingClientProxy.cs
- TriState.cs
- HandleExceptionArgs.cs
- BindingNavigator.cs
- DataGridView.cs
- HttpListenerContext.cs
- PixelShader.cs
- DynamicUpdateCommand.cs
- Process.cs
- ViewStateException.cs
- ConfigurationLocation.cs
- NullableIntSumAggregationOperator.cs
- XmlSchemaSequence.cs
- CodeIdentifier.cs
- ServiceContractViewControl.cs
- InplaceBitmapMetadataWriter.cs
- ElementHostAutomationPeer.cs
- DataGridViewRowCollection.cs
- OptimalTextSource.cs
- MenuItemBinding.cs
- HttpModulesSection.cs
- WebPartMinimizeVerb.cs
- CssStyleCollection.cs
- HttpCachePolicyWrapper.cs
- IdentifierCreationService.cs
- URLIdentityPermission.cs
- ThaiBuddhistCalendar.cs
- XmlIncludeAttribute.cs
- TemplateBindingExpression.cs
- LocalizationParserHooks.cs
- ErrorHandler.cs
- EditBehavior.cs
- WebPartZone.cs
- NoClickablePointException.cs
- AddIn.cs
- SHA256Managed.cs
- EventLogPermissionAttribute.cs
- DataGridViewEditingControlShowingEventArgs.cs
- CalendarDataBindingHandler.cs
- DBPropSet.cs
- SqlDataSourceEnumerator.cs
- DataKey.cs
- ToolStripContainerActionList.cs
- EdmValidator.cs
- UpdatePanelTrigger.cs
- IntegerValidatorAttribute.cs
- AuthorizationSection.cs
- PackageDigitalSignature.cs
- XmlSchema.cs
- TrailingSpaceComparer.cs
- EncoderExceptionFallback.cs
- DataGridViewMethods.cs
- RequestUriProcessor.cs
- StringReader.cs
- BuilderInfo.cs
- XPathSelectionIterator.cs
- CharAnimationBase.cs
- DesignerTransactionCloseEvent.cs
- ThumbButtonInfoCollection.cs
- ButtonBase.cs
- DataGridHeaderBorder.cs
- SamlDoNotCacheCondition.cs
- CompilerWrapper.cs
- InternalBufferOverflowException.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- UIElement.cs
- ErrorFormatter.cs
- LinearQuaternionKeyFrame.cs
- ViewPort3D.cs
- RequestCache.cs
- StringFreezingAttribute.cs
- CharUnicodeInfo.cs
- DataSet.cs