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

            Assert.IsTrue(manager.IsBatchOpen);
        }
Ejemplo n.º 2
0
 public void EndBatch_EmptyBatch()
 {
     ChangeManager manager = new ChangeManager();
     manager.StartBatch("Empty Batch");
     manager.EndBatch();
     Assert.IsFalse(manager.CanUndo);
 }
Ejemplo 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);
        }
Ejemplo n.º 4
0
 public void Undo_WithEmptyStack()
 {
     ChangeManager manager = new ChangeManager();
     manager.Undo();
 }
Ejemplo n.º 5
0
 public void ChangeManager()
 {
     ChangeManager manager = new ChangeManager();
     Assert.IsFalse(manager.CanRedo);
     Assert.IsFalse(manager.CanUndo);
 }
Ejemplo n.º 6
0
 public BatchChange(string changeDescription, ChangeManager changeManager)
 {
     this.changeManager = changeManager;
     Description        = changeDescription;
 }
Ejemplo 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);
     }
 }