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); } } }
/// <summary> /// Event for element added. /// </summary> private void CompartmentItemAdded(object sender, DslModeling::ElementAddedEventArgs e) { // If in Undo, Redo or Rollback the compartment item rules are not run so we must refresh the compartment list at this point if required bool repaintOnly = !e.ModelElement.Store.InUndoRedoOrRollback; CompartmentItemAddRule.ElementAdded(e, repaintOnly); }
internal static void ElementPropertyChanged(DslModeling::ElementPropertyChangedEventArgs e, bool repaintOnly) { if (e == null) { throw new global::System.ArgumentNullException("e"); } if (e.ModelElement is global::Microsoft.EntityFrameworkCore.Modeling.Property && e.DomainProperty.Id == global::Microsoft.EntityFrameworkCore.Modeling.Property.NameDomainPropertyId) { global::System.Collections.IEnumerable elements = CompartmentItemAddRule.GetEntityTypeForEntityTypeShapeProperties((global::Microsoft.EntityFrameworkCore.Modeling.Property)e.ModelElement); CompartmentItemAddRule.UpdateCompartments(elements, typeof(global::Microsoft.EntityFrameworkCore.Modeling.EntityTypeShape), "Properties", repaintOnly); } }
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); } }
internal static void RolePlayerPositionChanged(DslModeling::RolePlayerOrderChangedEventArgs 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.CounterpartDomainRole.IsSource) { global::System.Collections.IEnumerable elements = CompartmentItemAddRule.GetEntityTypeForEntityTypeShapeProperties((global::Microsoft.EntityFrameworkCore.Modeling.Property)e.CounterpartRolePlayer); CompartmentItemAddRule.UpdateCompartments(elements, typeof(global::Microsoft.EntityFrameworkCore.Modeling.EntityTypeShape), "Properties", repaintOnly); } } }