Пример #1
0
 /// <summary>
 /// Attempt to restore the state of this <see cref="Source"/> from the specified <paramref name="State"/>.
 /// </summary>
 /// <param name="State">A <see cref="SourceState"/> object to restore from.</param>
 public void Restore(SourceState State)
 {
     if (State.Source == this)
     {
         Position = State.Position;
     }
     else
     {
         throw new SourceStateMismatchException();
     }
 }
Пример #2
0
 /// <summary>
 /// Determines whether this <see cref="SourceState"/> and the <paramref name="other"/> <see cref="SourceState"/> are equal.
 /// </summary>
 /// <param name="other">The <see cref="SourceState"/> to compare to</param>
 /// <returns><c>true</c> if equal; otherwise, <c>false</c>.</returns>
 public Boolean Equals(SourceState other) => Position.Equals(other.Position) && Source.Equals(other.Source);