/// <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::Ufba.Ev.Type && e.DomainProperty.Id == global::Ufba.Ev.Type.NameDomainPropertyId) { global::System.Collections.IEnumerable elements = CompartmentItemAddRule.GetOptionForOptionShapeActions((global::Ufba.Ev.Type)e.ModelElement); CompartmentItemAddRule.UpdateCompartments(elements, typeof(global::Ufba.Ev.OptionShape), "Actions", repaintOnly); } if (e.ModelElement is global::Ufba.Ev.Property && e.DomainProperty.Id == global::Ufba.Ev.Property.NameDomainPropertyId) { global::System.Collections.IEnumerable elements = CompartmentItemAddRule.GetOptionForOptionShapeProperties((global::Ufba.Ev.Property)e.ModelElement); CompartmentItemAddRule.UpdateCompartments(elements, typeof(global::Ufba.Ev.OptionShape), "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::Ufba.Ev.OptionHasTypes) { global::System.Collections.ICollection elements = CompartmentItemAddRule.GetOptionForOptionShapeActionsFromLastLink((global::Ufba.Ev.OptionHasTypes)e.ModelElement); CompartmentItemAddRule.UpdateCompartments(elements, typeof(global::Ufba.Ev.OptionShape), "Actions", repaintOnly); } if (e.ModelElement is global::Ufba.Ev.OptionHasProperties) { global::System.Collections.ICollection elements = CompartmentItemAddRule.GetOptionForOptionShapePropertiesFromLastLink((global::Ufba.Ev.OptionHasProperties)e.ModelElement); CompartmentItemAddRule.UpdateCompartments(elements, typeof(global::Ufba.Ev.OptionShape), "Properties", repaintOnly); } }
internal static void RolePlayerPositionChanged(DslModeling::RolePlayerOrderChangedEventArgs e, bool repaintOnly) { if (e == null) { throw new global::System.ArgumentNullException("e"); } if (typeof(global::Ufba.Ev.OptionHasTypes).IsAssignableFrom(e.DomainRelationship.ImplementationClass)) { if (!e.CounterpartDomainRole.IsSource) { global::System.Collections.IEnumerable elements = CompartmentItemAddRule.GetOptionForOptionShapeActions((global::Ufba.Ev.Type)e.CounterpartRolePlayer); CompartmentItemAddRule.UpdateCompartments(elements, typeof(global::Ufba.Ev.OptionShape), "Actions", repaintOnly); } } if (typeof(global::Ufba.Ev.OptionHasProperties).IsAssignableFrom(e.DomainRelationship.ImplementationClass)) { if (!e.CounterpartDomainRole.IsSource) { global::System.Collections.IEnumerable elements = CompartmentItemAddRule.GetOptionForOptionShapeProperties((global::Ufba.Ev.Property)e.CounterpartRolePlayer); CompartmentItemAddRule.UpdateCompartments(elements, typeof(global::Ufba.Ev.OptionShape), "Properties", repaintOnly); } } }
internal static void RolePlayerChanged(DslModeling::RolePlayerChangedEventArgs e, bool repaintOnly) { if (e == null) { throw new global::System.ArgumentNullException("e"); } if (typeof(global::Ufba.Ev.OptionHasTypes).IsAssignableFrom(e.DomainRelationship.ImplementationClass)) { if (e.DomainRole.IsSource) { //global::System.Collections.IEnumerable oldElements = CompartmentItemAddRule.GetOptionForOptionShapeActionsFromLastLink((global::Ufba.Ev.Type)e.OldRolePlayer); //foreach(DslModeling::ModelElement element in oldElements) //{ // DslModeling::LinkedElementCollection<DslDiagrams::PresentationElement> pels = DslDiagrams::PresentationViewsSubject.GetPresentation(element); // foreach(DslDiagrams::PresentationElement pel in pels) // { // global::Ufba.Ev.OptionShape compartmentShape = pel as global::Ufba.Ev.OptionShape; // if(compartmentShape != null) // { // compartmentShape.GetCompartmentMappings()[0].InitializeCompartmentShape(compartmentShape); // } // } //} global::System.Collections.IEnumerable elements = CompartmentItemAddRule.GetOptionForOptionShapeActionsFromLastLink((global::Ufba.Ev.OptionHasTypes)e.ElementLink); CompartmentItemAddRule.UpdateCompartments(elements, typeof(global::Ufba.Ev.OptionShape), "Actions", repaintOnly); } else { global::System.Collections.IEnumerable elements = CompartmentItemAddRule.GetOptionForOptionShapeActions((global::Ufba.Ev.Type)e.NewRolePlayer); CompartmentItemAddRule.UpdateCompartments(elements, typeof(global::Ufba.Ev.OptionShape), "Actions", repaintOnly); } } if (typeof(global::Ufba.Ev.OptionHasProperties).IsAssignableFrom(e.DomainRelationship.ImplementationClass)) { if (e.DomainRole.IsSource) { //global::System.Collections.IEnumerable oldElements = CompartmentItemAddRule.GetOptionForOptionShapePropertiesFromLastLink((global::Ufba.Ev.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::Ufba.Ev.OptionShape compartmentShape = pel as global::Ufba.Ev.OptionShape; // if(compartmentShape != null) // { // compartmentShape.GetCompartmentMappings()[1].InitializeCompartmentShape(compartmentShape); // } // } //} global::System.Collections.IEnumerable elements = CompartmentItemAddRule.GetOptionForOptionShapePropertiesFromLastLink((global::Ufba.Ev.OptionHasProperties)e.ElementLink); CompartmentItemAddRule.UpdateCompartments(elements, typeof(global::Ufba.Ev.OptionShape), "Properties", repaintOnly); } else { global::System.Collections.IEnumerable elements = CompartmentItemAddRule.GetOptionForOptionShapeProperties((global::Ufba.Ev.Property)e.NewRolePlayer); CompartmentItemAddRule.UpdateCompartments(elements, typeof(global::Ufba.Ev.OptionShape), "Properties", repaintOnly); } } }