Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / EntityModel / SchemaObjectModel / RowTypeElement.cs / 1305376 / RowTypeElement.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 RowTypeElement : ModelFunctionTypeElement { private SchemaElementLookUpTable_properties = new SchemaElementLookUpTable (); #region constructor /// /// /// /// internal RowTypeElement(SchemaElement parentElement) : base(parentElement) { } protected override bool HandleElement(XmlReader reader) { if (CanHandleElement(reader, XmlConstants.Property)) { HandlePropertyElement(reader); return true; } return false; } protected void HandlePropertyElement(XmlReader reader) { Debug.Assert(reader != null); var property = new RowTypePropertyElement(this); property.Parse(reader); _properties.Add(property, true, Strings.DuplicateEntityContainerMemberName /**/); } #endregion internal override void ResolveTopLevelNames() { foreach (var property in _properties) { property.ResolveTopLevelNames(); } } internal override void WriteIdentity(StringBuilder builder) { builder.Append("Row["); bool first = true; foreach (RowTypePropertyElement property in _properties) { if (first) { first = !first; } else { builder.Append(", "); } property.WriteIdentity(builder); } builder.Append("]"); } internal override TypeUsage GetTypeUsage() { if (_typeUsage == null) { var listOfProperties = new List(); foreach (var property in _properties) { var edmProperty = new EdmProperty(property.FQName, property.GetTypeUsage()); edmProperty.AddMetadataProperties(property.OtherContent); //edmProperty.DeclaringType listOfProperties.Add(edmProperty); } RowType rowType = new RowType(listOfProperties); rowType.DataSpace = DataSpace.CSpace; rowType.AddMetadataProperties(this.OtherContent); _typeUsage = TypeUsage.Create(rowType); } return _typeUsage; } internal override bool ResolveNameAndSetTypeUsage(Converter.ConversionCache convertedItemCache, Dictionary newGlobalItems) { bool result = true; if (_typeUsage == null) { foreach (var property in _properties) { if (!property.ResolveNameAndSetTypeUsage(convertedItemCache, newGlobalItems)) { result = false; } } } return result; } internal override void Validate() { foreach (var property in _properties) { property.Validate(); } if (_properties.Count == 0) { AddError(ErrorCode.RowTypeWithoutProperty, EdmSchemaErrorSeverity.Error, Strings.RowTypeWithoutProperty); } } } } // 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
- Utils.cs
- BitmapImage.cs
- PerformanceCountersElement.cs
- LayoutEditorPart.cs
- NamedPipeTransportManager.cs
- Opcode.cs
- BindableTemplateBuilder.cs
- DBCommandBuilder.cs
- CardSpaceException.cs
- ProviderCollection.cs
- Calendar.cs
- PreviewPrintController.cs
- SamlAssertion.cs
- AuthenticationService.cs
- PasswordRecovery.cs
- XPathNodeList.cs
- AdornerPresentationContext.cs
- DockAndAnchorLayout.cs
- WindowsClientCredential.cs
- Speller.cs
- SecurityResources.cs
- XmlNotation.cs
- TransformedBitmap.cs
- AuthenticationConfig.cs
- PlatformCulture.cs
- PropertyIdentifier.cs
- DeploymentExceptionMapper.cs
- BlurEffect.cs
- UserControlDocumentDesigner.cs
- basemetadatamappingvisitor.cs
- DataSetUtil.cs
- ComplexTypeEmitter.cs
- AssemblyCache.cs
- Preprocessor.cs
- ConfigurationValue.cs
- GeneralTransform3DTo2D.cs
- ProfileSection.cs
- SqlConnection.cs
- BypassElementCollection.cs
- XmlBoundElement.cs
- HttpDictionary.cs
- ClientConvert.cs
- AttributeUsageAttribute.cs
- TableItemPattern.cs
- DescendantBaseQuery.cs
- MultiDataTrigger.cs
- ParserStack.cs
- DocumentPageHost.cs
- ResourceWriter.cs
- ToolStripItemRenderEventArgs.cs
- embossbitmapeffect.cs
- AppDomain.cs
- BrowserCapabilitiesFactory.cs
- WebBrowserDocumentCompletedEventHandler.cs
- DataSetMappper.cs
- OraclePermissionAttribute.cs
- EdmComplexTypeAttribute.cs
- XmlComment.cs
- Expressions.cs
- ComboBox.cs
- NetDispatcherFaultException.cs
- StrongName.cs
- ObjectSet.cs
- SmtpAuthenticationManager.cs
- MarginsConverter.cs
- CharStorage.cs
- KeyboardNavigation.cs
- CalculatedColumn.cs
- TypeInitializationException.cs
- UInt16Storage.cs
- MapPathBasedVirtualPathProvider.cs
- Misc.cs
- PersonalizationStateQuery.cs
- SignatureToken.cs
- ProfileGroupSettings.cs
- UnsettableComboBox.cs
- ListInitExpression.cs
- _ContextAwareResult.cs
- CodeGenerator.cs
- ProxyWebPartManager.cs
- X509PeerCertificateElement.cs
- validationstate.cs
- GregorianCalendarHelper.cs
- DropDownList.cs
- ToolStripDropTargetManager.cs
- wgx_exports.cs
- SafeHandles.cs
- CuspData.cs
- DependsOnAttribute.cs
- MessageQueueConverter.cs
- SupportsPreviewControlAttribute.cs
- HttpHandler.cs
- ApplyTemplatesAction.cs
- ComponentDispatcher.cs
- ThreadStartException.cs
- LockCookie.cs
- BindingsCollection.cs
- XmlLangPropertyAttribute.cs
- ErrorFormatter.cs
- SQLBoolean.cs