Exemplo n.º 1
0
 public void AddAction(ITrackingAction action)
 {
     lock (actionLocker)
     {
         LastActions.Insert(0, action);
         RevertedActions.Clear();
     }
 }
Exemplo n.º 2
0
        public void AddAction(Func <ITrackingAction> action)
        {
            lock (actionLocker)
            {
                using (var logger = new TrackingLoggerScope(Logs, "Add"))
                {
                    var newItem = action();
                    logger.Type = newItem.GetType().Name;
                    LastActions.Insert(0, newItem);
                }

                RevertedActions.Clear();
            }
        }
Exemplo n.º 3
0
        public void Remake()
        {
            lock (actionLocker)
            {
                var lastItem = RevertedActions.FirstOrDefault();

                if (lastItem == null)
                {
                    return;
                }

                using (var logger = new TrackingLoggerScope(Logs, "Remake", lastItem.GetType().Name))
                    lastItem.Apply();

                RevertedActions.Remove(lastItem);
                LastActions.Insert(0, lastItem);
            }
        }