コード例 #1
0
		public static DslModeling::ElementLink Connect(DslModeling::ModelElement source, DslModeling::ModelElement target)
		{
			if (source == null)
			{
				throw new global::System.ArgumentNullException("source");
			}
			if (target == null)
			{
				throw new global::System.ArgumentNullException("target");
			}
			
			if (CanAcceptSourceAndTarget(source, target))
			{
				if (source is global::NuPattern.Authoring.WorkflowDesign.ProducedAsset)
				{
					if (target is global::NuPattern.Authoring.WorkflowDesign.ProductionTool)
					{
						global::NuPattern.Authoring.WorkflowDesign.ProducedAsset sourceAccepted = (global::NuPattern.Authoring.WorkflowDesign.ProducedAsset)source;
						global::NuPattern.Authoring.WorkflowDesign.ProductionTool targetAccepted = (global::NuPattern.Authoring.WorkflowDesign.ProductionTool)target;
						DslModeling::ElementLink result = new global::NuPattern.Authoring.WorkflowDesign.ProducedAssetSuppliesProductionTools(sourceAccepted, targetAccepted);
						if (DslModeling::DomainClassInfo.HasNameProperty(result))
						{
							DslModeling::DomainClassInfo.SetUniqueName(result);
						}
						return result;
					}
				}
				if (source is global::NuPattern.Authoring.WorkflowDesign.SuppliedAsset)
				{
					if (target is global::NuPattern.Authoring.WorkflowDesign.ProducedAsset)
					{
						global::NuPattern.Authoring.WorkflowDesign.SuppliedAsset sourceAccepted = (global::NuPattern.Authoring.WorkflowDesign.SuppliedAsset)source;
						global::NuPattern.Authoring.WorkflowDesign.ProducedAsset targetAccepted = (global::NuPattern.Authoring.WorkflowDesign.ProducedAsset)target;
						DslModeling::ElementLink result = new global::NuPattern.Authoring.WorkflowDesign.SuppliedAssetCopiesToProducedAssets(sourceAccepted, targetAccepted);
						if (DslModeling::DomainClassInfo.HasNameProperty(result))
						{
							DslModeling::DomainClassInfo.SetUniqueName(result);
						}
						return result;
					}
					else if (target is global::NuPattern.Authoring.WorkflowDesign.ProductionTool)
					{
						global::NuPattern.Authoring.WorkflowDesign.SuppliedAsset sourceAccepted = (global::NuPattern.Authoring.WorkflowDesign.SuppliedAsset)source;
						global::NuPattern.Authoring.WorkflowDesign.ProductionTool targetAccepted = (global::NuPattern.Authoring.WorkflowDesign.ProductionTool)target;
						DslModeling::ElementLink result = new global::NuPattern.Authoring.WorkflowDesign.SuppliedAssetSuppliesProductionTools(sourceAccepted, targetAccepted);
						if (DslModeling::DomainClassInfo.HasNameProperty(result))
						{
							DslModeling::DomainClassInfo.SetUniqueName(result);
						}
						return result;
					}
				}
				if (source is global::NuPattern.Authoring.WorkflowDesign.ProductionTool)
				{
					if (target is global::NuPattern.Authoring.WorkflowDesign.ProducedAsset)
					{
						global::NuPattern.Authoring.WorkflowDesign.ProductionTool sourceAccepted = (global::NuPattern.Authoring.WorkflowDesign.ProductionTool)source;
						global::NuPattern.Authoring.WorkflowDesign.ProducedAsset targetAccepted = (global::NuPattern.Authoring.WorkflowDesign.ProducedAsset)target;
						DslModeling::ElementLink result = new global::NuPattern.Authoring.WorkflowDesign.ProductionToolProducesProducedAssets(sourceAccepted, targetAccepted);
						if (DslModeling::DomainClassInfo.HasNameProperty(result))
						{
							DslModeling::DomainClassInfo.SetUniqueName(result);
						}
						return result;
					}
					else if (target is global::NuPattern.Authoring.WorkflowDesign.VariabilityRequirement)
					{
						global::NuPattern.Authoring.WorkflowDesign.ProductionTool sourceAccepted = (global::NuPattern.Authoring.WorkflowDesign.ProductionTool)source;
						global::NuPattern.Authoring.WorkflowDesign.VariabilityRequirement targetAccepted = (global::NuPattern.Authoring.WorkflowDesign.VariabilityRequirement)target;
						DslModeling::ElementLink result = new global::NuPattern.Authoring.WorkflowDesign.ProductionToolReferencesVariabilityRequirements(sourceAccepted, targetAccepted);
						if (DslModeling::DomainClassInfo.HasNameProperty(result))
						{
							DslModeling::DomainClassInfo.SetUniqueName(result);
						}
						return result;
					}
				}
				
			}
			global::System.Diagnostics.Debug.Fail("Having agreed that the connection can be accepted we should never fail to make one.");
			throw new global::System.InvalidOperationException();
		}
コード例 #2
0
        public static DslModeling::ElementLink Connect(DslModeling::ModelElement source, DslModeling::ModelElement target)
        {
            if (source == null)
            {
                throw new global::System.ArgumentNullException("source");
            }
            if (target == null)
            {
                throw new global::System.ArgumentNullException("target");
            }

            if (CanAcceptSourceAndTarget(source, target))
            {
                if (source is global::NuPattern.Authoring.WorkflowDesign.ProducedAsset)
                {
                    if (target is global::NuPattern.Authoring.WorkflowDesign.ProductionTool)
                    {
                        global::NuPattern.Authoring.WorkflowDesign.ProducedAsset  sourceAccepted = (global::NuPattern.Authoring.WorkflowDesign.ProducedAsset)source;
                        global::NuPattern.Authoring.WorkflowDesign.ProductionTool targetAccepted = (global::NuPattern.Authoring.WorkflowDesign.ProductionTool)target;
                        DslModeling::ElementLink result = new global::NuPattern.Authoring.WorkflowDesign.ProducedAssetSuppliesProductionTools(sourceAccepted, targetAccepted);
                        if (DslModeling::DomainClassInfo.HasNameProperty(result))
                        {
                            DslModeling::DomainClassInfo.SetUniqueName(result);
                        }
                        return(result);
                    }
                }
                if (source is global::NuPattern.Authoring.WorkflowDesign.SuppliedAsset)
                {
                    if (target is global::NuPattern.Authoring.WorkflowDesign.ProducedAsset)
                    {
                        global::NuPattern.Authoring.WorkflowDesign.SuppliedAsset sourceAccepted = (global::NuPattern.Authoring.WorkflowDesign.SuppliedAsset)source;
                        global::NuPattern.Authoring.WorkflowDesign.ProducedAsset targetAccepted = (global::NuPattern.Authoring.WorkflowDesign.ProducedAsset)target;
                        DslModeling::ElementLink result = new global::NuPattern.Authoring.WorkflowDesign.SuppliedAssetCopiesToProducedAssets(sourceAccepted, targetAccepted);
                        if (DslModeling::DomainClassInfo.HasNameProperty(result))
                        {
                            DslModeling::DomainClassInfo.SetUniqueName(result);
                        }
                        return(result);
                    }
                    else if (target is global::NuPattern.Authoring.WorkflowDesign.ProductionTool)
                    {
                        global::NuPattern.Authoring.WorkflowDesign.SuppliedAsset  sourceAccepted = (global::NuPattern.Authoring.WorkflowDesign.SuppliedAsset)source;
                        global::NuPattern.Authoring.WorkflowDesign.ProductionTool targetAccepted = (global::NuPattern.Authoring.WorkflowDesign.ProductionTool)target;
                        DslModeling::ElementLink result = new global::NuPattern.Authoring.WorkflowDesign.SuppliedAssetSuppliesProductionTools(sourceAccepted, targetAccepted);
                        if (DslModeling::DomainClassInfo.HasNameProperty(result))
                        {
                            DslModeling::DomainClassInfo.SetUniqueName(result);
                        }
                        return(result);
                    }
                }
                if (source is global::NuPattern.Authoring.WorkflowDesign.ProductionTool)
                {
                    if (target is global::NuPattern.Authoring.WorkflowDesign.ProducedAsset)
                    {
                        global::NuPattern.Authoring.WorkflowDesign.ProductionTool sourceAccepted = (global::NuPattern.Authoring.WorkflowDesign.ProductionTool)source;
                        global::NuPattern.Authoring.WorkflowDesign.ProducedAsset  targetAccepted = (global::NuPattern.Authoring.WorkflowDesign.ProducedAsset)target;
                        DslModeling::ElementLink result = new global::NuPattern.Authoring.WorkflowDesign.ProductionToolProducesProducedAssets(sourceAccepted, targetAccepted);
                        if (DslModeling::DomainClassInfo.HasNameProperty(result))
                        {
                            DslModeling::DomainClassInfo.SetUniqueName(result);
                        }
                        return(result);
                    }
                    else if (target is global::NuPattern.Authoring.WorkflowDesign.VariabilityRequirement)
                    {
                        global::NuPattern.Authoring.WorkflowDesign.ProductionTool         sourceAccepted = (global::NuPattern.Authoring.WorkflowDesign.ProductionTool)source;
                        global::NuPattern.Authoring.WorkflowDesign.VariabilityRequirement targetAccepted = (global::NuPattern.Authoring.WorkflowDesign.VariabilityRequirement)target;
                        DslModeling::ElementLink result = new global::NuPattern.Authoring.WorkflowDesign.ProductionToolReferencesVariabilityRequirements(sourceAccepted, targetAccepted);
                        if (DslModeling::DomainClassInfo.HasNameProperty(result))
                        {
                            DslModeling::DomainClassInfo.SetUniqueName(result);
                        }
                        return(result);
                    }
                }
            }
            global::System.Diagnostics.Debug.Fail("Having agreed that the connection can be accepted we should never fail to make one.");
            throw new global::System.InvalidOperationException();
        }