Exemplo n.º 1
0
        public void StartBatch()
        {
            ChangeManager manager = new ChangeManager();
            manager.StartBatch("batch");

            Assert.IsTrue(manager.IsBatchOpen);
        }
Exemplo n.º 2
0
 public void EndBatch_EmptyBatch()
 {
     ChangeManager manager = new ChangeManager();
     manager.StartBatch("Empty Batch");
     manager.EndBatch();
     Assert.IsFalse(manager.CanUndo);
 }
Exemplo n.º 3
0
        public void RegisterMap()
        {
            var t = new MapTree();
            var r = new MapNode(t, "r");
            ChangeManager manager = new ChangeManager();
            manager.RegisterMap(t);

            r.Text = "changed";

            Assert.IsTrue(manager.CanUndo);
        }
Exemplo n.º 4
0
 public void Undo_WithEmptyStack()
 {
     ChangeManager manager = new ChangeManager();
     manager.Undo();
 }
Exemplo n.º 5
0
 public void ChangeManager()
 {
     ChangeManager manager = new ChangeManager();
     Assert.IsFalse(manager.CanRedo);
     Assert.IsFalse(manager.CanUndo);
 }
Exemplo n.º 6
0
 public BatchChange(string changeDescription, ChangeManager changeManager)
 {
     this.changeManager = changeManager;
     Description        = changeDescription;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Change Manager is off by default (helps in deserialization).
 /// It is mandatory to turn on ChangeManager (MapCtrl and others assume that it is on).
 /// </summary>
 public void TurnOnChangeManager()
 {
     if(!ChangeManagerOn)
     {
         ChangeManager = new ChangeManager();
         ChangeManager.RegisterMap(this);
     }
 }