//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using DslModeling = global::Microsoft.VisualStudio.Modeling;
using DslDesign = global::Microsoft.VisualStudio.Modeling.Design;
using DslDiagrams = global::Microsoft.VisualStudio.Modeling.Diagrams;
namespace MDC.ProductionSystem
{
	/// <summary>
	/// DomainModel ProductionSystemDomainModel
	/// Description for MDC.ProductionSystem.ProductionSystem
	/// </summary>
	[DslDesign::DisplayNameResource("MDC.ProductionSystem.ProductionSystemDomainModel.DisplayName", typeof(global::MDC.ProductionSystem.ProductionSystemDomainModel), "MDC.ProductionSystem.GeneratedCode.DomainModelResx")]
	[DslDesign::DescriptionResource("MDC.ProductionSystem.ProductionSystemDomainModel.Description", typeof(global::MDC.ProductionSystem.ProductionSystemDomainModel), "MDC.ProductionSystem.GeneratedCode.DomainModelResx")]
	[global::System.CLSCompliant(true)]
	[DslModeling::DependsOnDomainModel(typeof(global::Microsoft.VisualStudio.Modeling.CoreDomainModel))]
	[DslModeling::DependsOnDomainModel(typeof(global::Microsoft.VisualStudio.Modeling.Diagrams.CoreDesignSurfaceDomainModel))]
	[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Generated code.")]
	[DslModeling::DomainObjectId("5cfba0ca-3374-4229-8e5b-5105c625e1d5")]
	public partial class ProductionSystemDomainModel : DslModeling::DomainModel
	{
		#region Constructor, domain model Id
	
		/// <summary>
		/// ProductionSystemDomainModel domain model Id.
		/// </summary>
		public static readonly global::System.Guid DomainModelId = new global::System.Guid(0x5cfba0ca, 0x3374, 0x4229, 0x8e, 0x5b, 0x51, 0x05, 0xc6, 0x25, 0xe1, 0xd5);
	
		/// <summary>
		/// Constructor.
		/// </summary>
		/// <param name="store">Store containing the domain model.</param>
		public ProductionSystemDomainModel(DslModeling::Store store)
			: base(store, DomainModelId)
		{
			// Call the partial method to allow any required serialization setup to be done.
			this.InitializeSerialization(store);		
		}
		
	
		///<Summary>
		/// Defines a partial method that will be called from the constructor to
		/// allow any necessary serialization setup to be done.
		///</Summary>
		///<remarks>
		/// For a DSL created with the DSL Designer wizard, an implementation of this 
		/// method will be generated in the GeneratedCode\SerializationHelper.cs class.
		///</remarks>
		partial void InitializeSerialization(DslModeling::Store store);
	
	
		#endregion
		#region Domain model reflection
			
		/// <summary>
		/// Gets the list of generated domain model types (classes, rules, relationships).
		/// </summary>
		/// <returns>List of types.</returns>
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Generated code.")]	
		protected sealed override global::System.Type[] GetGeneratedDomainModelTypes()
		{
			return new global::System.Type[]
			{
				typeof(PS_Model),
				typeof(Machine),
				typeof(ConveyorBelt),
				typeof(Component),
				typeof(Operator),
				typeof(ProducingUnit),
				typeof(Garage),
				typeof(ProcessingUnit),
				typeof(Generator),
				typeof(Assembler),
				typeof(RepairBay),
				typeof(QualityControl),
				typeof(WheelGenerator),
				typeof(TrackGenerator),
				typeof(BodyGenerator),
				typeof(GunGenerator),
				typeof(WaterGenerator),
				typeof(Wheel),
				typeof(Track),
				typeof(Body),
				typeof(Gun),
				typeof(Water),
				typeof(ProductionSystemHasMachines),
				typeof(PS_ModelHasConveyorBelts),
				typeof(PS_ModelHasComponents),
				typeof(PS_ModelHasOperators),
				typeof(MachineIsConnectedToConveyorBelt),
				typeof(ConveyorBeltsConnectedToMachines),
				typeof(ConveyorBeltsConnectedToConveyorBelt),
				typeof(ComponentIsOnConveyorBelt),
				typeof(OperatorControlsProcessingUnits),
				typeof(ProductionSystemDiagram),
				typeof(ConveyorConveyor),
				typeof(MachineConveyor),
				typeof(ConveyorMachine),
				typeof(ComponentConveyor),
				typeof(OperatorProcessingUnit),
				typeof(ConveyorShape),
				typeof(AssemblerShape),
				typeof(RepairShape),
				typeof(QualityShape),
				typeof(WheelGenShape),
				typeof(TrackGenShape),
				typeof(BodyGenShape),
				typeof(GunGenShape),
				typeof(WaterGenShape),
				typeof(WheelShape),
				typeof(TrackShape),
				typeof(BodyShape),
				typeof(GunShape),
				typeof(WaterShape),
				typeof(OperatorShape),
				typeof(ProcessingUnitShape),
				typeof(MachineShape),
				typeof(ComponentShape),
				typeof(GarageShape),
				typeof(global::MDC.ProductionSystem.FixUpDiagram),
				typeof(global::MDC.ProductionSystem.DecoratorPropertyChanged),
				typeof(global::MDC.ProductionSystem.ConnectorRolePlayerChanged),
			};
		}
		/// <summary>
		/// Gets the list of generated domain properties.
		/// </summary>
		/// <returns>List of property data.</returns>
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Generated code.")]	
		protected sealed override DomainMemberInfo[] GetGeneratedDomainProperties()
		{
			return new DomainMemberInfo[]
			{
				new DomainMemberInfo(typeof(Component), "isBroken", Component.isBrokenDomainPropertyId, typeof(Component.isBrokenPropertyHandler)),
				new DomainMemberInfo(typeof(Operator), "Name", Operator.NameDomainPropertyId, typeof(Operator.NamePropertyHandler)),
				new DomainMemberInfo(typeof(Operator), "Stress", Operator.StressDomainPropertyId, typeof(Operator.StressPropertyHandler)),
				new DomainMemberInfo(typeof(ProducingUnit), "Reliability", ProducingUnit.ReliabilityDomainPropertyId, typeof(ProducingUnit.ReliabilityPropertyHandler)),
				new DomainMemberInfo(typeof(ProcessingUnit), "IdleTime", ProcessingUnit.IdleTimeDomainPropertyId, typeof(ProcessingUnit.IdleTimePropertyHandler)),
				new DomainMemberInfo(typeof(Generator), "Output", Generator.OutputDomainPropertyId, typeof(Generator.OutputPropertyHandler)),
				new DomainMemberInfo(typeof(Body), "Loadout", Body.LoadoutDomainPropertyId, typeof(Body.LoadoutPropertyHandler)),
			};
		}
		/// <summary>
		/// Gets the list of generated domain roles.
		/// </summary>
		/// <returns>List of role data.</returns>
		protected sealed override DomainRolePlayerInfo[] GetGeneratedDomainRoles()
		{
			return new DomainRolePlayerInfo[]
			{
				new DomainRolePlayerInfo(typeof(ProductionSystemHasMachines), "PS_Model", ProductionSystemHasMachines.PS_ModelDomainRoleId),
				new DomainRolePlayerInfo(typeof(ProductionSystemHasMachines), "Element", ProductionSystemHasMachines.ElementDomainRoleId),
				new DomainRolePlayerInfo(typeof(PS_ModelHasConveyorBelts), "PS_Model", PS_ModelHasConveyorBelts.PS_ModelDomainRoleId),
				new DomainRolePlayerInfo(typeof(PS_ModelHasConveyorBelts), "ConveyorBelt", PS_ModelHasConveyorBelts.ConveyorBeltDomainRoleId),
				new DomainRolePlayerInfo(typeof(PS_ModelHasComponents), "PS_Model", PS_ModelHasComponents.PS_ModelDomainRoleId),
				new DomainRolePlayerInfo(typeof(PS_ModelHasComponents), "Component", PS_ModelHasComponents.ComponentDomainRoleId),
				new DomainRolePlayerInfo(typeof(PS_ModelHasOperators), "PS_Model", PS_ModelHasOperators.PS_ModelDomainRoleId),
				new DomainRolePlayerInfo(typeof(PS_ModelHasOperators), "Operator", PS_ModelHasOperators.OperatorDomainRoleId),
				new DomainRolePlayerInfo(typeof(MachineIsConnectedToConveyorBelt), "MA_CB_Machine", MachineIsConnectedToConveyorBelt.MA_CB_MachineDomainRoleId),
				new DomainRolePlayerInfo(typeof(MachineIsConnectedToConveyorBelt), "MA_CB_ConveyorBelt", MachineIsConnectedToConveyorBelt.MA_CB_ConveyorBeltDomainRoleId),
				new DomainRolePlayerInfo(typeof(ConveyorBeltsConnectedToMachines), "CB_MA_ConveyorBelt", ConveyorBeltsConnectedToMachines.CB_MA_ConveyorBeltDomainRoleId),
				new DomainRolePlayerInfo(typeof(ConveyorBeltsConnectedToMachines), "CB_MA_Machine", ConveyorBeltsConnectedToMachines.CB_MA_MachineDomainRoleId),
				new DomainRolePlayerInfo(typeof(ConveyorBeltsConnectedToConveyorBelt), "CB_CB_SourceConveyorBelt", ConveyorBeltsConnectedToConveyorBelt.CB_CB_SourceConveyorBeltDomainRoleId),
				new DomainRolePlayerInfo(typeof(ConveyorBeltsConnectedToConveyorBelt), "CB_CB_TargetConveyorBelt", ConveyorBeltsConnectedToConveyorBelt.CB_CB_TargetConveyorBeltDomainRoleId),
				new DomainRolePlayerInfo(typeof(ComponentIsOnConveyorBelt), "CO_CB_Component", ComponentIsOnConveyorBelt.CO_CB_ComponentDomainRoleId),
				new DomainRolePlayerInfo(typeof(ComponentIsOnConveyorBelt), "CO_CB_ConveyorBelt", ComponentIsOnConveyorBelt.CO_CB_ConveyorBeltDomainRoleId),
				new DomainRolePlayerInfo(typeof(OperatorControlsProcessingUnits), "OP_PU_Operator", OperatorControlsProcessingUnits.OP_PU_OperatorDomainRoleId),
				new DomainRolePlayerInfo(typeof(OperatorControlsProcessingUnits), "OP_PU_ProcessingUnit", OperatorControlsProcessingUnits.OP_PU_ProcessingUnitDomainRoleId),
			};
		}
		#endregion
		#region Factory methods
		private static global::System.Collections.Generic.Dictionary<global::System.Type, int> createElementMap;
	
		/// <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>
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Generated code.")]	
		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>(47);
				createElementMap.Add(typeof(PS_Model), 0);
				createElementMap.Add(typeof(Machine), 1);
				createElementMap.Add(typeof(ConveyorBelt), 2);
				createElementMap.Add(typeof(Component), 3);
				createElementMap.Add(typeof(Operator), 4);
				createElementMap.Add(typeof(ProducingUnit), 5);
				createElementMap.Add(typeof(Garage), 6);
				createElementMap.Add(typeof(ProcessingUnit), 7);
				createElementMap.Add(typeof(Generator), 8);
				createElementMap.Add(typeof(Assembler), 9);
				createElementMap.Add(typeof(RepairBay), 10);
				createElementMap.Add(typeof(QualityControl), 11);
				createElementMap.Add(typeof(WheelGenerator), 12);
				createElementMap.Add(typeof(TrackGenerator), 13);
				createElementMap.Add(typeof(BodyGenerator), 14);
				createElementMap.Add(typeof(GunGenerator), 15);
				createElementMap.Add(typeof(WaterGenerator), 16);
				createElementMap.Add(typeof(Wheel), 17);
				createElementMap.Add(typeof(Track), 18);
				createElementMap.Add(typeof(Body), 19);
				createElementMap.Add(typeof(Gun), 20);
				createElementMap.Add(typeof(Water), 21);
				createElementMap.Add(typeof(ProductionSystemDiagram), 22);
				createElementMap.Add(typeof(ConveyorConveyor), 23);
				createElementMap.Add(typeof(MachineConveyor), 24);
				createElementMap.Add(typeof(ConveyorMachine), 25);
				createElementMap.Add(typeof(ComponentConveyor), 26);
				createElementMap.Add(typeof(OperatorProcessingUnit), 27);
				createElementMap.Add(typeof(ConveyorShape), 28);
				createElementMap.Add(typeof(AssemblerShape), 29);
				createElementMap.Add(typeof(RepairShape), 30);
				createElementMap.Add(typeof(QualityShape), 31);
				createElementMap.Add(typeof(WheelGenShape), 32);
				createElementMap.Add(typeof(TrackGenShape), 33);
				createElementMap.Add(typeof(BodyGenShape), 34);
				createElementMap.Add(typeof(GunGenShape), 35);
				createElementMap.Add(typeof(WaterGenShape), 36);
				createElementMap.Add(typeof(WheelShape), 37);
				createElementMap.Add(typeof(TrackShape), 38);
				createElementMap.Add(typeof(BodyShape), 39);
				createElementMap.Add(typeof(GunShape), 40);
				createElementMap.Add(typeof(WaterShape), 41);
				createElementMap.Add(typeof(OperatorShape), 42);
				createElementMap.Add(typeof(ProcessingUnitShape), 43);
				createElementMap.Add(typeof(MachineShape), 44);
				createElementMap.Add(typeof(ComponentShape), 45);
				createElementMap.Add(typeof(GarageShape), 46);
			}
			int index;
			if (!createElementMap.TryGetValue(elementType, out index))
			{
				// construct exception error message		
				string exceptionError = string.Format(
								global::System.Globalization.CultureInfo.CurrentCulture,
								global::MDC.ProductionSystem.ProductionSystemDomainModel.SingletonResourceManager.GetString("UnrecognizedElementType"),
								elementType.Name);
				throw new global::System.ArgumentException(exceptionError, "elementType");
			}
			switch (index)
			{
				case 0: return new PS_Model(partition, propertyAssignments);
				case 1: return new Machine(partition, propertyAssignments);
				case 2: return new ConveyorBelt(partition, propertyAssignments);
				case 3: return new Component(partition, propertyAssignments);
				case 4: return new Operator(partition, propertyAssignments);
				case 5: return new ProducingUnit(partition, propertyAssignments);
				case 6: return new Garage(partition, propertyAssignments);
				case 7: return new ProcessingUnit(partition, propertyAssignments);
				case 8: return new Generator(partition, propertyAssignments);
				case 9: return new Assembler(partition, propertyAssignments);
				case 10: return new RepairBay(partition, propertyAssignments);
				case 11: return new QualityControl(partition, propertyAssignments);
				case 12: return new WheelGenerator(partition, propertyAssignments);
				case 13: return new TrackGenerator(partition, propertyAssignments);
				case 14: return new BodyGenerator(partition, propertyAssignments);
				case 15: return new GunGenerator(partition, propertyAssignments);
				case 16: return new WaterGenerator(partition, propertyAssignments);
				case 17: return new Wheel(partition, propertyAssignments);
				case 18: return new Track(partition, propertyAssignments);
				case 19: return new Body(partition, propertyAssignments);
				case 20: return new Gun(partition, propertyAssignments);
				case 21: return new Water(partition, propertyAssignments);
				case 22: return new ProductionSystemDiagram(partition, propertyAssignments);
				case 23: return new ConveyorConveyor(partition, propertyAssignments);
				case 24: return new MachineConveyor(partition, propertyAssignments);
				case 25: return new ConveyorMachine(partition, propertyAssignments);
				case 26: return new ComponentConveyor(partition, propertyAssignments);
				case 27: return new OperatorProcessingUnit(partition, propertyAssignments);
				case 28: return new ConveyorShape(partition, propertyAssignments);
				case 29: return new AssemblerShape(partition, propertyAssignments);
				case 30: return new RepairShape(partition, propertyAssignments);
				case 31: return new QualityShape(partition, propertyAssignments);
				case 32: return new WheelGenShape(partition, propertyAssignments);
				case 33: return new TrackGenShape(partition, propertyAssignments);
				case 34: return new BodyGenShape(partition, propertyAssignments);
				case 35: return new GunGenShape(partition, propertyAssignments);
				case 36: return new WaterGenShape(partition, propertyAssignments);
				case 37: return new WheelShape(partition, propertyAssignments);
				case 38: return new TrackShape(partition, propertyAssignments);
				case 39: return new BodyShape(partition, propertyAssignments);
				case 40: return new GunShape(partition, propertyAssignments);
				case 41: return new WaterShape(partition, propertyAssignments);
				case 42: return new OperatorShape(partition, propertyAssignments);
				case 43: return new ProcessingUnitShape(partition, propertyAssignments);
				case 44: return new MachineShape(partition, propertyAssignments);
				case 45: return new ComponentShape(partition, propertyAssignments);
				case 46: return new GarageShape(partition, propertyAssignments);
				default: return null;
			}
		}
	
		private static global::System.Collections.Generic.Dictionary<global::System.Type, int> createElementLinkMap;
	
		/// <summary>
		/// Creates an element link of specified type.
		/// </summary>
		/// <param name="partition">Partition where element is to be created.</param>
		/// <param name="elementLinkType">Element link type which belongs to this domain model.</param>
		/// <param name="roleAssignments">List of relationship role assignments for the new link.</param>
		/// <param name="propertyAssignments">New element property assignments.</param>
		/// <returns>Created element link.</returns>
		[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
		public sealed override DslModeling::ElementLink CreateElementLink(DslModeling::Partition partition, global::System.Type elementLinkType, DslModeling::RoleAssignment[] roleAssignments, DslModeling::PropertyAssignment[] propertyAssignments)
		{
			if (elementLinkType == null) throw new global::System.ArgumentNullException("elementLinkType");
			if (roleAssignments == null) throw new global::System.ArgumentNullException("roleAssignments");
	
			if (createElementLinkMap == null)
			{
				createElementLinkMap = new global::System.Collections.Generic.Dictionary<global::System.Type, int>(9);
				createElementLinkMap.Add(typeof(ProductionSystemHasMachines), 0);
				createElementLinkMap.Add(typeof(PS_ModelHasConveyorBelts), 1);
				createElementLinkMap.Add(typeof(PS_ModelHasComponents), 2);
				createElementLinkMap.Add(typeof(PS_ModelHasOperators), 3);
				createElementLinkMap.Add(typeof(MachineIsConnectedToConveyorBelt), 4);
				createElementLinkMap.Add(typeof(ConveyorBeltsConnectedToMachines), 5);
				createElementLinkMap.Add(typeof(ConveyorBeltsConnectedToConveyorBelt), 6);
				createElementLinkMap.Add(typeof(ComponentIsOnConveyorBelt), 7);
				createElementLinkMap.Add(typeof(OperatorControlsProcessingUnits), 8);
			}
			int index;
			if (!createElementLinkMap.TryGetValue(elementLinkType, out index))
			{
				// construct exception error message
				string exceptionError = string.Format(
								global::System.Globalization.CultureInfo.CurrentCulture,
								global::MDC.ProductionSystem.ProductionSystemDomainModel.SingletonResourceManager.GetString("UnrecognizedElementLinkType"),
								elementLinkType.Name);
				throw new global::System.ArgumentException(exceptionError, "elementLinkType");
			
			}
			switch (index)
			{
				case 0: return new ProductionSystemHasMachines(partition, roleAssignments, propertyAssignments);
				case 1: return new PS_ModelHasConveyorBelts(partition, roleAssignments, propertyAssignments);
				case 2: return new PS_ModelHasComponents(partition, roleAssignments, propertyAssignments);
				case 3: return new PS_ModelHasOperators(partition, roleAssignments, propertyAssignments);
				case 4: return new MachineIsConnectedToConveyorBelt(partition, roleAssignments, propertyAssignments);
				case 5: return new ConveyorBeltsConnectedToMachines(partition, roleAssignments, propertyAssignments);
				case 6: return new ConveyorBeltsConnectedToConveyorBelt(partition, roleAssignments, propertyAssignments);
				case 7: return new ComponentIsOnConveyorBelt(partition, roleAssignments, propertyAssignments);
				case 8: return new OperatorControlsProcessingUnits(partition, roleAssignments, propertyAssignments);
				default: return null;
			}
		}
		#endregion
		#region Resource manager
		
		private static global::System.Resources.ResourceManager resourceManager;
		
		/// <summary>
		/// The base name of this model's resources.
		/// </summary>
		public const string ResourceBaseName = "MDC.ProductionSystem.GeneratedCode.DomainModelResx";
		
		/// <summary>
		/// Gets the DomainModel's ResourceManager. If the ResourceManager does not already exist, then it is created.
		/// </summary>
		public override global::System.Resources.ResourceManager ResourceManager
		{
			[global::System.Diagnostics.DebuggerStepThrough]
			get
			{
				return ProductionSystemDomainModel.SingletonResourceManager;
			}
		}
	
		/// <summary>
		/// Gets the Singleton ResourceManager for this domain model.
		/// </summary>
		public static global::System.Resources.ResourceManager SingletonResourceManager
		{
			[global::System.Diagnostics.DebuggerStepThrough]
			get
			{
				if (ProductionSystemDomainModel.resourceManager == null)
				{
					ProductionSystemDomainModel.resourceManager = new global::System.Resources.ResourceManager(ResourceBaseName, typeof(ProductionSystemDomainModel).Assembly);
				}
				return ProductionSystemDomainModel.resourceManager;
			}
		}
		#endregion
		#region Copy/Remove closures
		/// <summary>
		/// CopyClosure cache
		/// </summary>
		private static DslModeling::IElementVisitorFilter copyClosure;
		/// <summary>
		/// DeleteClosure cache
		/// </summary>
		private static DslModeling::IElementVisitorFilter removeClosure;
		/// <summary>
		/// Returns an IElementVisitorFilter that corresponds to the ClosureType.
		/// </summary>
		/// <param name="type">closure type</param>
		/// <param name="rootElements">collection of root elements</param>
		/// <returns>IElementVisitorFilter or null</returns>
		public override DslModeling::IElementVisitorFilter GetClosureFilter(DslModeling::ClosureType type, global::System.Collections.Generic.ICollection<DslModeling::ModelElement> rootElements)
		{
			switch (type)
			{
				case DslModeling::ClosureType.CopyClosure:
					return ProductionSystemDomainModel.CopyClosure;
				case DslModeling::ClosureType.DeleteClosure:
					return ProductionSystemDomainModel.DeleteClosure;
			}
			return base.GetClosureFilter(type, rootElements);
		}
		/// <summary>
		/// CopyClosure cache
		/// </summary>
		private static DslModeling::IElementVisitorFilter CopyClosure
		{
			get
			{
				// Incorporate all of the closures from the models we extend
				if (ProductionSystemDomainModel.copyClosure == null)
				{
					DslModeling::ChainingElementVisitorFilter copyFilter = new DslModeling::ChainingElementVisitorFilter();
					copyFilter.AddFilter(new ProductionSystemCopyClosure());
					copyFilter.AddFilter(new DslModeling::CoreCopyClosure());
					copyFilter.AddFilter(new DslDiagrams::CoreDesignSurfaceCopyClosure());
					
					ProductionSystemDomainModel.copyClosure = copyFilter;
				}
				return ProductionSystemDomainModel.copyClosure;
			}
		}
		/// <summary>
		/// DeleteClosure cache
		/// </summary>
		private static DslModeling::IElementVisitorFilter DeleteClosure
		{
			get
			{
				// Incorporate all of the closures from the models we extend
				if (ProductionSystemDomainModel.removeClosure == null)
				{
					DslModeling::ChainingElementVisitorFilter removeFilter = new DslModeling::ChainingElementVisitorFilter();
					removeFilter.AddFilter(new ProductionSystemDeleteClosure());
					removeFilter.AddFilter(new DslModeling::CoreDeleteClosure());
					removeFilter.AddFilter(new DslDiagrams::CoreDesignSurfaceDeleteClosure());
		
					ProductionSystemDomainModel.removeClosure = removeFilter;
				}
				return ProductionSystemDomainModel.removeClosure;
			}
		}
		#endregion
		#region Diagram rule helpers
		/// <summary>
		/// Enables rules in this domain model related to diagram fixup for the given store.
		/// If diagram data will be loaded into the store, this method should be called first to ensure
		/// that the diagram behaves properly.
		/// </summary>
		public static void EnableDiagramRules(DslModeling::Store store)
		{
			if(store == null) throw new global::System.ArgumentNullException("store");
			
			DslModeling::RuleManager ruleManager = store.RuleManager;
			ruleManager.EnableRule(typeof(global::MDC.ProductionSystem.FixUpDiagram));
			ruleManager.EnableRule(typeof(global::MDC.ProductionSystem.DecoratorPropertyChanged));
			ruleManager.EnableRule(typeof(global::MDC.ProductionSystem.ConnectorRolePlayerChanged));
		}
		
		/// <summary>
		/// Disables rules in this domain model related to diagram fixup for the given store.
		/// </summary>
		public static void DisableDiagramRules(DslModeling::Store store)
		{
			if(store == null) throw new global::System.ArgumentNullException("store");
			
			DslModeling::RuleManager ruleManager = store.RuleManager;
			ruleManager.DisableRule(typeof(global::MDC.ProductionSystem.FixUpDiagram));
			ruleManager.DisableRule(typeof(global::MDC.ProductionSystem.DecoratorPropertyChanged));
			ruleManager.DisableRule(typeof(global::MDC.ProductionSystem.ConnectorRolePlayerChanged));
		}
		#endregion
	}
		
	#region Copy/Remove closure classes
	/// <summary>
	/// Remove closure visitor filter
	/// </summary>
	[global::System.CLSCompliant(true)]
	public partial class ProductionSystemDeleteClosure : ProductionSystemDeleteClosureBase, DslModeling::IElementVisitorFilter
	{
		/// <summary>
		/// Constructor
		/// </summary>
		public ProductionSystemDeleteClosure() : base()
		{
		}
	}
	
	/// <summary>
	/// Base class for remove closure visitor filter
	/// </summary>
	[global::System.CLSCompliant(true)]
	public partial class ProductionSystemDeleteClosureBase : DslModeling::IElementVisitorFilter
	{
		/// <summary>
		/// DomainRoles
		/// </summary>
		private global::System.Collections.Specialized.HybridDictionary domainRoles;
		/// <summary>
		/// Constructor
		/// </summary>
		public ProductionSystemDeleteClosureBase()
		{
			#region Initialize DomainData Table
			DomainRoles.Add(global::MDC.ProductionSystem.ProductionSystemHasMachines.ElementDomainRoleId, true);
			DomainRoles.Add(global::MDC.ProductionSystem.PS_ModelHasConveyorBelts.ConveyorBeltDomainRoleId, true);
			DomainRoles.Add(global::MDC.ProductionSystem.PS_ModelHasComponents.ComponentDomainRoleId, true);
			DomainRoles.Add(global::MDC.ProductionSystem.PS_ModelHasOperators.OperatorDomainRoleId, true);
			#endregion
		}
		/// <summary>
		/// Called to ask the filter if a particular relationship from a source element should be included in the traversal
		/// </summary>
		/// <param name="walker">ElementWalker that is traversing the model</param>
		/// <param name="sourceElement">Model Element playing the source role</param>
		/// <param name="sourceRoleInfo">DomainRoleInfo of the role that the source element is playing in the relationship</param>
		/// <param name="domainRelationshipInfo">DomainRelationshipInfo for the ElementLink in question</param>
		/// <param name="targetRelationship">Relationship in question</param>
		/// <returns>Yes if the relationship should be traversed</returns>
		public virtual DslModeling::VisitorFilterResult ShouldVisitRelationship(DslModeling::ElementWalker walker, DslModeling::ModelElement sourceElement, DslModeling::DomainRoleInfo sourceRoleInfo, DslModeling::DomainRelationshipInfo domainRelationshipInfo, DslModeling::ElementLink targetRelationship)
		{
			return DslModeling::VisitorFilterResult.Yes;
		}
		/// <summary>
		/// Called to ask the filter if a particular role player should be Visited during traversal
		/// </summary>
		/// <param name="walker">ElementWalker that is traversing the model</param>
		/// <param name="sourceElement">Model Element playing the source role</param>
		/// <param name="elementLink">Element Link that forms the relationship to the role player in question</param>
		/// <param name="targetDomainRole">DomainRoleInfo of the target role</param>
		/// <param name="targetRolePlayer">Model Element that plays the target role in the relationship</param>
		/// <returns></returns>
		public virtual DslModeling::VisitorFilterResult ShouldVisitRolePlayer(DslModeling::ElementWalker walker, DslModeling::ModelElement sourceElement, DslModeling::ElementLink elementLink, DslModeling::DomainRoleInfo targetDomainRole, DslModeling::ModelElement targetRolePlayer)
		{
			if (targetDomainRole == null) throw new global::System.ArgumentNullException("targetDomainRole");
			return this.DomainRoles.Contains(targetDomainRole.Id) ? DslModeling::VisitorFilterResult.Yes : DslModeling::VisitorFilterResult.DoNotCare;
		}
		/// <summary>
		/// DomainRoles
		/// </summary>
		private global::System.Collections.Specialized.HybridDictionary DomainRoles
		{
			get
			{
				if (this.domainRoles == null)
				{
					this.domainRoles = new global::System.Collections.Specialized.HybridDictionary();
				}
				return this.domainRoles;
			}
		}
	
	}
	/// <summary>
	/// Copy closure visitor filter
	/// </summary>
	[global::System.CLSCompliant(true)]
	public partial class ProductionSystemCopyClosure : ProductionSystemCopyClosureBase, DslModeling::IElementVisitorFilter
	{
		/// <summary>
		/// Constructor
		/// </summary>
		public ProductionSystemCopyClosure() : base()
		{
		}
	}
	/// <summary>
	/// Base class for copy closure visitor filter
	/// </summary>
	[global::System.CLSCompliant(true)]
	public partial class ProductionSystemCopyClosureBase : DslModeling::CopyClosureFilter, DslModeling::IElementVisitorFilter
	{
		/// <summary>
		/// Constructor
		/// </summary>
		public ProductionSystemCopyClosureBase():base()
		{
		}
	}
	#endregion
		
}
namespace MDC.ProductionSystem
{
	/// <summary>
	/// DomainEnumeration: LoadoutKind
	/// Description for MDC.ProductionSystem.LoadoutKind
	/// </summary>
	[global::System.CLSCompliant(true)]
	public enum LoadoutKind
	{
		/// <summary>
		/// NoLoadout
		/// Description for MDC.ProductionSystem.LoadoutKind.NoLoadout
		/// </summary>
		[DslDesign::DescriptionResource("MDC.ProductionSystem.LoadoutKind/NoLoadout.Description", typeof(global::MDC.ProductionSystem.ProductionSystemDomainModel), "MDC.ProductionSystem.GeneratedCode.DomainModelResx")]
		NoLoadout,
		/// <summary>
		/// ArmyLoadout
		/// Description for MDC.ProductionSystem.LoadoutKind.ArmyLoadout
		/// </summary>
		[DslDesign::DescriptionResource("MDC.ProductionSystem.LoadoutKind/ArmyLoadout.Description", typeof(global::MDC.ProductionSystem.ProductionSystemDomainModel), "MDC.ProductionSystem.GeneratedCode.DomainModelResx")]
		ArmyLoadout,
		/// <summary>
		/// RiotLoadout
		/// Description for MDC.ProductionSystem.LoadoutKind.RiotLoadout
		/// </summary>
		[DslDesign::DescriptionResource("MDC.ProductionSystem.LoadoutKind/RiotLoadout.Description", typeof(global::MDC.ProductionSystem.ProductionSystemDomainModel), "MDC.ProductionSystem.GeneratedCode.DomainModelResx")]
		RiotLoadout,
	}
}
namespace MDC.ProductionSystem
{
	/// <summary>
	/// DomainEnumeration: BrokenTypes
	/// Description for MDC.ProductionSystem.BrokenTypes
	/// </summary>
	[global::System.CLSCompliant(true)]
	public enum BrokenTypes
	{
		/// <summary>
		/// WORKING
		/// Description for MDC.ProductionSystem.BrokenTypes.WORKING
		/// </summary>
		[DslDesign::DescriptionResource("MDC.ProductionSystem.BrokenTypes/WORKING.Description", typeof(global::MDC.ProductionSystem.ProductionSystemDomainModel), "MDC.ProductionSystem.GeneratedCode.DomainModelResx")]
		WORKING,
		/// <summary>
		/// BROKEN
		/// Description for MDC.ProductionSystem.BrokenTypes.BROKEN
		/// </summary>
		[DslDesign::DescriptionResource("MDC.ProductionSystem.BrokenTypes/BROKEN.Description", typeof(global::MDC.ProductionSystem.ProductionSystemDomainModel), "MDC.ProductionSystem.GeneratedCode.DomainModelResx")]
		BROKEN,
	}
}

