Пример #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::UPM_IPS.RAARMAPMCWeberMDD.Relacion)
                {
                    if (target is global::UPM_IPS.RAARMAPMCWeberMDD.Entidad)
                    {
                        global::UPM_IPS.RAARMAPMCWeberMDD.Relacion sourceAccepted = (global::UPM_IPS.RAARMAPMCWeberMDD.Relacion)source;
                        global::UPM_IPS.RAARMAPMCWeberMDD.Entidad  targetAccepted = (global::UPM_IPS.RAARMAPMCWeberMDD.Entidad)target;
                        DslModeling::ElementLink result = new global::UPM_IPS.RAARMAPMCWeberMDD.RelacionReferencesEntidadDer(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 global::UPM_IPS.RAARMAPMCWeberMDD.WebERMDD GetParentForEntidad(global::UPM_IPS.RAARMAPMCWeberMDD.Entidad root)
 {
     // Segments 0 and 1
     global::UPM_IPS.RAARMAPMCWeberMDD.WebERMDD result = root.WebERMDD;
     if (result == null)
     {
         return(null);
     }
     return(result);
 }
Пример #3
0
 public static global::UPM_IPS.RAARMAPMCWeberMDD.WebERMDD GetParentForAtributoEnt(global::UPM_IPS.RAARMAPMCWeberMDD.AtributoEnt root)
 {
     // Segments 0 and 1
     global::UPM_IPS.RAARMAPMCWeberMDD.Entidad root2 = root.Entidad;
     if (root2 == null)
     {
         return(null);
     }
     // Segments 2 and 3
     global::UPM_IPS.RAARMAPMCWeberMDD.WebERMDD result = root2.WebERMDD;
     if (result == null)
     {
         return(null);
     }
     return(result);
 }
Пример #4
0
        public static bool CanAcceptSourceAndTarget(DslModeling::ModelElement candidateSource, DslModeling::ModelElement candidateTarget)
        {
            // Accepts null, null; source, null; source, target but NOT null, target
            if (candidateSource == null)
            {
                if (candidateTarget != null)
                {
                    throw new global::System.ArgumentNullException("candidateSource");
                }
                else                 // Both null
                {
                    return(false);
                }
            }
            bool acceptSource = CanAcceptSource(candidateSource);

            // If the source wasn't accepted then there's no point checking targets.
            // If there is no target then the source controls the accept.
            if (!acceptSource || candidateTarget == null)
            {
                return(acceptSource);
            }
            else             // Check combinations
            {
                if (candidateSource is global::UPM_IPS.RAARMAPMCWeberMDD.Relacion)
                {
                    if (candidateTarget is global::UPM_IPS.RAARMAPMCWeberMDD.Entidad)
                    {
                        global::UPM_IPS.RAARMAPMCWeberMDD.Relacion sourceRelacion = (global::UPM_IPS.RAARMAPMCWeberMDD.Relacion)candidateSource;
                        global::UPM_IPS.RAARMAPMCWeberMDD.Entidad  targetEntidad  = (global::UPM_IPS.RAARMAPMCWeberMDD.Entidad)candidateTarget;
                        if (sourceRelacion == null || global::UPM_IPS.RAARMAPMCWeberMDD.RelacionReferencesEntidadDer.GetLinkToEntidadDer(sourceRelacion) != null)
                        {
                            return(false);
                        }
                        if (targetEntidad == null || sourceRelacion == null || global::UPM_IPS.RAARMAPMCWeberMDD.RelacionReferencesEntidadDer.GetLinks(sourceRelacion, targetEntidad).Count > 0)
                        {
                            return(false);
                        }
                        return(true);
                    }
                }
            }
            return(false);
        }