src/Misc/EFTools/EntityDesignEntityDesigner/GeneratedCode/Serializer.cs
/// <summary>
/// Construct the apping from XmlTagName to DomainClassInfo that derives from EntityDesignerViewModelHasEntityTypes.
/// </summary>
/// <param name="serializationContext">Serialization context.</param>
/// <param name="domainDataDirectory">DomainDataDirectory to be used to discover all derived classes.</param>
Construct the apping from XmlTagName to DomainClassInfo that derives from EntityDesignerViewModelHasEntityTypes.
Construct the apping from XmlTagName to DomainClassInfo that derives from EntityDesignerViewModelHasEntityTypes .
private void ConstructDerivedClassesLookupTable(DslModeling::SerializationContext serializationContext, DslModeling::DomainDataDirectory domainDataDirectory)
		{
			global::System.Diagnostics.Debug.Assert(this.derivedClasses == null); 
			this.derivedClasses = new global::System.Collections.Generic.Dictionary<string, DslModeling::DomainClassInfo> (global::System.StringComparer.CurrentCulture);
			DslModeling::DomainClassInfo thisClass = domainDataDirectory.GetDomainClass(EntityDesignerViewModelHasEntityTypes.DomainClassId);
			global::System.Diagnostics.Debug.Assert(thisClass != null, "Cannot find DomainClassInfo for ModelRoot!");
			global::System.Collections.ObjectModel.ReadOnlyCollection<DslModeling::DomainClassInfo> descendents = thisClass.AllDescendants;
			if (descendents != null)
			{
				foreach (DslModeling::DomainClassInfo descendent in descendents)
				{
					global::System.Type descendentType = descendent.ImplementationClass;
					if (!descendentType.IsAbstract)
					{
						DslModeling::DomainClassXmlSerializer descendentSerializer = serializationContext.Directory.GetSerializer(descendent.Id);
						if (descendentSerializer != null)
						{
							string descendentXmlTagName = descendentSerializer.XmlTagName;
							if (!string.IsNullOrEmpty (descendentXmlTagName))
							{
								global::System.Diagnostics.Debug.Assert(!this.derivedClasses.ContainsKey (descendentXmlTagName));
								this.derivedClasses.Add (descendentXmlTagName, descendent);
							}
						}
					}
					else
					{   
					}
				}
			}
		}
private void ConstructDerivedClassesLookupTable ( DslModeling :: SerializationContext serializationContext , DslModeling :: DomainDataDirectory domainDataDirectory ) { global :: System . Diagnostics . Debug . Assert ( this . derivedClasses == null ) ; this . derivedClasses = new global :: System . Collections . Generic . Dictionary < string , DslModeling :: DomainClassInfo > ( global :: System . StringComparer . CurrentCulture ) ; DslModeling :: DomainClassInfo thisClass = domainDataDirectory . GetDomainClass ( EntityDesignerViewModelHasEntityTypes . DomainClassId ) ; global :: System . Diagnostics . Debug . Assert ( thisClass != null , " " ) ; global :: System . Collections . ObjectModel . ReadOnlyCollection < DslModeling :: DomainClassInfo > descendents = thisClass . AllDescendants ; if ( descendents != null ) { foreach ( DslModeling :: DomainClassInfo descendent in descendents ) { global :: System . Type descendentType = descendent . ImplementationClass ; if ( ! descendentType . IsAbstract ) { DslModeling :: DomainClassXmlSerializer descendentSerializer = serializationContext . Directory . GetSerializer ( descendent . Id ) ; if ( descendentSerializer != null ) { string descendentXmlTagName = descendentSerializer . XmlTagName ; if ( ! string . IsNullOrEmpty ( descendentXmlTagName ) ) { global :: System . Diagnostics . Debug . Assert ( ! this . derivedClasses . ContainsKey ( descendentXmlTagName ) ) ; this . derivedClasses . Add ( descendentXmlTagName , descendent ) ; } } } else { } } } }
Construct the apping from XmlTagName to DomainClassInfo that derives from EntityDesignerViewModelHasEntityTypes.
Construct the apping from XmlTagName to DomainClassInfo that derives from EntityDesignerViewModelHasEntityTypes .
// Shouldn't construct the table more than once. // Ignore abstract derived classes because they cannot be instantiated directly.
serializationContext
DslModeling::SerializationContext
None
domainDataDirectory
DslModeling::DomainDataDirectory
DomainDataDirectory to be used to discover all derived classes.
DomainDataDirectory to be used to discover all derived classes .