Advertisement
dmitryzenevich

Memento

Oct 23rd, 2021
744
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement