Ejemplo n.º 1
0
        internal static void RolePlayerChanged(DslModeling::RolePlayerChangedEventArgs e, bool repaintOnly)
        {
            if (e == null)
            {
                throw new global::System.ArgumentNullException("e");
            }
            if (typeof(global::Microsoft.EntityFrameworkCore.Modeling.EntityTypeHasProperties).IsAssignableFrom(e.DomainRelationship.ImplementationClass))
            {
                if (e.DomainRole.IsSource)
                {
                    //global::System.Collections.IEnumerable oldElements = CompartmentItemAddRule.GetEntityTypeForEntityTypeShapePropertiesFromLastLink((global::Microsoft.EntityFrameworkCore.Modeling.Property)e.OldRolePlayer);
                    //foreach(DslModeling::ModelElement element in oldElements)
                    //{
                    //	DslModeling::LinkedElementCollection<DslDiagrams::PresentationElement> pels = DslDiagrams::PresentationViewsSubject.GetPresentation(element);
                    //	foreach(DslDiagrams::PresentationElement pel in pels)
                    //	{
                    //		global::Microsoft.EntityFrameworkCore.Modeling.EntityTypeShape compartmentShape = pel as global::Microsoft.EntityFrameworkCore.Modeling.EntityTypeShape;
                    //		if(compartmentShape != null)
                    //		{
                    //			compartmentShape.GetCompartmentMappings()[0].InitializeCompartmentShape(compartmentShape);
                    //		}
                    //	}
                    //}

                    global::System.Collections.IEnumerable elements = CompartmentItemAddRule.GetEntityTypeForEntityTypeShapePropertiesFromLastLink((global::Microsoft.EntityFrameworkCore.Modeling.EntityTypeHasProperties)e.ElementLink);
                    CompartmentItemAddRule.UpdateCompartments(elements, typeof(global::Microsoft.EntityFrameworkCore.Modeling.EntityTypeShape), "Properties", repaintOnly);
                }
                else
                {
                    global::System.Collections.IEnumerable elements = CompartmentItemAddRule.GetEntityTypeForEntityTypeShapeProperties((global::Microsoft.EntityFrameworkCore.Modeling.Property)e.NewRolePlayer);
                    CompartmentItemAddRule.UpdateCompartments(elements, typeof(global::Microsoft.EntityFrameworkCore.Modeling.EntityTypeShape), "Properties", repaintOnly);
                }
            }
        }
Ejemplo n.º 2
0
 internal static void ElementDeleted(DslModeling::ElementDeletedEventArgs e, bool repaintOnly)
 {
     if (e == null)
     {
         throw new global::System.ArgumentNullException("e");
     }
     if (e.ModelElement is global::Microsoft.EntityFrameworkCore.Modeling.EntityTypeHasProperties)
     {
         global::System.Collections.ICollection elements = CompartmentItemAddRule.GetEntityTypeForEntityTypeShapePropertiesFromLastLink((global::Microsoft.EntityFrameworkCore.Modeling.EntityTypeHasProperties)e.ModelElement);
         CompartmentItemAddRule.UpdateCompartments(elements, typeof(global::Microsoft.EntityFrameworkCore.Modeling.EntityTypeShape), "Properties", repaintOnly);
     }
 }