Example #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::nHydrate.Dsl.Entity)
                {
                    if (target is global::nHydrate.Dsl.Entity)
                    {
                        global::nHydrate.Dsl.Entity sourceAccepted = (global::nHydrate.Dsl.Entity)source;
                        global::nHydrate.Dsl.Entity targetAccepted = (global::nHydrate.Dsl.Entity)target;
                        DslModeling::ElementLink    result         = new global::nHydrate.Dsl.EntityHasEntities(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();
        }
Example #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::nHydrate.Dsl.Entity)
				{
					if (target is global::nHydrate.Dsl.Entity)
					{
						global::nHydrate.Dsl.Entity sourceAccepted = (global::nHydrate.Dsl.Entity)source;
						global::nHydrate.Dsl.Entity targetAccepted = (global::nHydrate.Dsl.Entity)target;
						DslModeling::ElementLink result = new global::nHydrate.Dsl.EntityHasEntities(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();
		}