예제 #1
0
        public static void ChangeMultiplicityOfElement(Model.MultiplicityElement element, XCase.Model.Element associatedElement, uint?lower, UnlimitedNatural upper, ModelController modelControlller)
        {
            ChangeElementMultiplicityMacroCommand c = (ChangeElementMultiplicityMacroCommand)ChangeElementMultiplicityMacroCommandFactory.Factory().Create(modelControlller);

            if (associatedElement != null)
            {
                c.AssociatedElements.Add(associatedElement);
            }
            c.Lower   = lower;
            c.Upper   = upper;
            c.Element = element;
            c.InitializeCommand();
            if (c.Commands.Count > 0)
            {
                c.Execute();
            }
        }
예제 #2
0
 public static bool MultiplicityOneOrNone(this Model.MultiplicityElement element)
 {
     return((element.Lower == 1 || element.Lower == 0) && element.Upper == 1);
 }