src/Misc/EFTools/EntityDesignEntityDesigner/GeneratedCode/DomainModel.cs
/// <summary>
/// Creates an element of specified type.
/// </summary>
/// <param name="partition">Partition where element is to be created.</param>
/// <param name="elementType">Element type which belongs to this domain model.</param>
/// <param name="propertyAssignments">New element property assignments.</param>
/// <returns>Created element.</returns>
Creates an element of specified type.
Creates an element of specified type .
public sealed override DslModeling::ModelElement CreateElement(DslModeling::Partition partition, global::System.Type elementType, DslModeling::PropertyAssignment[] propertyAssignments)
		{
			if (elementType == null) throw new global::System.ArgumentNullException("elementType");
			if (createElementMap == null)
			{
				createElementMap = new global::System.Collections.Generic.Dictionary<global::System.Type, int>(12);
				createElementMap.Add(typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityDesignerViewModel), 0);
				createElementMap.Add(typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType), 1);
				createElementMap.Add(typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.NavigationProperty), 2);
				createElementMap.Add(typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.ComplexProperty), 3);
				createElementMap.Add(typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.ScalarProperty), 4);
				createElementMap.Add(typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.View.EntityDesignerDiagram), 5);
				createElementMap.Add(typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.View.InheritanceConnector), 6);
				createElementMap.Add(typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.View.AssociationConnector), 7);
				createElementMap.Add(typeof(global::Microsoft.Data.Entity.Design.EntityDesigner.View.EntityTypeShape), 8);
			}
			int index;
			if (!createElementMap.TryGetValue(elementType, out index))
			{
				string exceptionError = string.Format(
								global::System.Globalization.CultureInfo.CurrentCulture,
								global::Microsoft.Data.Entity.Design.EntityDesigner.MicrosoftDataEntityDesignDomainModel.SingletonResourceManager.GetString("UnrecognizedElementType"),
								elementType.Name);
				throw new global::System.ArgumentException(exceptionError, "elementType");
			}
			switch (index)
			{
				case 0: return new global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityDesignerViewModel(partition, propertyAssignments);
				case 1: return new global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.EntityType(partition, propertyAssignments);
				case 2: return new global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.NavigationProperty(partition, propertyAssignments);
				case 3: return new global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.ComplexProperty(partition, propertyAssignments);
				case 4: return new global::Microsoft.Data.Entity.Design.EntityDesigner.ViewModel.ScalarProperty(partition, propertyAssignments);
				case 5: return new global::Microsoft.Data.Entity.Design.EntityDesigner.View.EntityDesignerDiagram(partition, propertyAssignments);
				case 6: return new global::Microsoft.Data.Entity.Design.EntityDesigner.View.InheritanceConnector(partition, propertyAssignments);
				case 7: return new global::Microsoft.Data.Entity.Design.EntityDesigner.View.AssociationConnector(partition, propertyAssignments);
				case 8: return new global::Microsoft.Data.Entity.Design.EntityDesigner.View.EntityTypeShape(partition, propertyAssignments);
				default: return null;
			}
		}
public sealed override DslModeling :: ModelElement CreateElement ( DslModeling :: Partition partition , global :: System . Type elementType , DslModeling :: PropertyAssignment [ ] propertyAssignments ) { if ( elementType == null ) throw new global :: System . ArgumentNullException ( " " ) ; if ( createElementMap == null ) { createElementMap = new global :: System . Collections . Generic . Dictionary < global :: System . Type , int > ( 12 ) ; createElementMap . Add ( typeof ( global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . EntityDesignerViewModel ) , 0 ) ; createElementMap . Add ( typeof ( global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . EntityType ) , 1 ) ; createElementMap . Add ( typeof ( global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . NavigationProperty ) , 2 ) ; createElementMap . Add ( typeof ( global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . ComplexProperty ) , 3 ) ; createElementMap . Add ( typeof ( global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . ScalarProperty ) , 4 ) ; createElementMap . Add ( typeof ( global :: Microsoft . Data . Entity . Design . EntityDesigner . View . EntityDesignerDiagram ) , 5 ) ; createElementMap . Add ( typeof ( global :: Microsoft . Data . Entity . Design . EntityDesigner . View . InheritanceConnector ) , 6 ) ; createElementMap . Add ( typeof ( global :: Microsoft . Data . Entity . Design . EntityDesigner . View . AssociationConnector ) , 7 ) ; createElementMap . Add ( typeof ( global :: Microsoft . Data . Entity . Design . EntityDesigner . View . EntityTypeShape ) , 8 ) ; } int index ; if ( ! createElementMap . TryGetValue ( elementType , out index ) ) { string exceptionError = string . Format ( global :: System . Globalization . CultureInfo . CurrentCulture , global :: Microsoft . Data . Entity . Design . EntityDesigner . MicrosoftDataEntityDesignDomainModel . SingletonResourceManager . GetString ( " " ) , elementType . Name ) ; throw new global :: System . ArgumentException ( exceptionError , " " ) ; } switch ( index ) { case 0 : return new global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . EntityDesignerViewModel ( partition , propertyAssignments ) ; case 1 : return new global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . EntityType ( partition , propertyAssignments ) ; case 2 : return new global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . NavigationProperty ( partition , propertyAssignments ) ; case 3 : return new global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . ComplexProperty ( partition , propertyAssignments ) ; case 4 : return new global :: Microsoft . Data . Entity . Design . EntityDesigner . ViewModel . ScalarProperty ( partition , propertyAssignments ) ; case 5 : return new global :: Microsoft . Data . Entity . Design . EntityDesigner . View . EntityDesignerDiagram ( partition , propertyAssignments ) ; case 6 : return new global :: Microsoft . Data . Entity . Design . EntityDesigner . View . InheritanceConnector ( partition , propertyAssignments ) ; case 7 : return new global :: Microsoft . Data . Entity . Design . EntityDesigner . View . AssociationConnector ( partition , propertyAssignments ) ; case 8 : return new global :: Microsoft . Data . Entity . Design . EntityDesigner . View . EntityTypeShape ( partition , propertyAssignments ) ; default : return null ; } }
Creates an element of specified type.
Creates an element of specified type .
// construct exception error message		
None
partition
DslModeling::Partition
Partition where element is to be created.
Partition where element is to be created .
elementType
global::System.Type
Element type which belongs to this domain model.
Element type which belongs to this domain model .
propertyAssignments
DslModeling::PropertyAssignment[]
New element property assignments.
New element property assignments .