Ejemplo n.º 1
0
 /// <summary>
 /// Begins an edit on a TransitionRow.
 /// </summary>
 public void BeginEdit()
 {
     if (!isEditing)
     {
         backupTrans = trans;
         isEditing   = true;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Pushes changes since the last BeginEdit or IBindingList.AddNew call
 /// into the underlying StateRow.
 /// </summary>
 public void EndEdit()
 {
     if (isEditing)
     {
         backupTrans = new TransitionProperties();
         isEditing   = false;
         isNew       = false;
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Discards changes since the last BeginEdit call.
        /// </summary>
        public void CancelEdit()
        {
            if (isEditing)
            {
                trans     = backupTrans;
                isEditing = false;

                if (isNew)
                {
                    OnEditCancelled();
                }
            }
        }
Ejemplo n.º 4
0
        public void BuildParams_WhenCalledWithTransitions_VerifyExpectedOutput(
            TransitionProperties properties,
            Transition transition,
            string expected)
        {
            // Arrange
            _rotator.Transition = transition;
            _rotator.Params     = properties;

            // Act
            string result = _rotator.GetType().CallMethod(BuildParams, new object[0], _rotator) as string;

            // Assert
            result.ShouldSatisfyAllConditions(
                () => result.ShouldNotBeNull(),
                () => result.ShouldBe(expected),
                () => _rotator.IsContentMatched(new Rotator
            {
                Transition = transition,
                Params     = properties
            }, nameof(Rotator.Params)).ShouldBeTrue()
                );
        }