dmitryzenevich

Memento

Oct 23rd, 2021
668
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. namespace Core.Interfaces
  2. {
  3.     public interface IOriginator<TMemento> where TMemento : IMemento
  4.     {
  5.         TMemento SaveState();
  6.         void RestoreState(TMemento memento);
  7.     }
  8. }
  9.  
  10. namespace Core.Interfaces
  11. {
  12.     public interface IMemento
  13.     {
  14.         object State { get; }
  15.     }
  16.    
  17.     public interface IMemento<out TState> : IMemento
  18.     {
  19.         new TState State { get; }
  20.     }
  21. }
RAW Paste Data