Example #1
0
 public void SetUp()
 {
     _modifiers          = GetModifiers();
     _modifiersComponent = Substitute.For <IModifiersComponent>();
     _modifiersComponent.GetModifiers().Returns(_modifiers);
     _modifiersInterface = Substitute.ForPartsOf <ModifiersInterface>(new object[] { _modifiersComponent });
 }
Example #2
0
 public virtual ISelectable[] ApplyAll(ISelectable[] oldSelection, ISelectable[] newSelection, SelectionType type)
 {
     ISelectable[] actualSelection = newSelection;
     foreach (var mod in modifiers.GetModifiers())
     {
         if (mod.RestrictedTypes == null || mod.RestrictedTypes.Length == 0 || mod.RestrictedTypes.Contains(type))
         {
             SelectionInfo info = new SelectionInfo {
                 OldSelection = oldSelection, NewSelection = newSelection, ActualSelection = actualSelection, SelectionType = type
             };
             actualSelection = mod.Apply(info);
         }
     }
     return(actualSelection);
 }