コード例 #1
0
        public void DoAnything_EventMustBeFired()
        {
            var root = CreateRoot();
            var cw   = new ChangeWatcher(root);
            IConfigurationChangeInfo info = null;

            cw.ChangePushed += (o, e) =>
            {
                info = e;
            };
            root["a"] = "b";
            Assert.IsNotNull(info);
            EventArgs changeMgrArg = null;

            cw.ChangeMerged += (o, e) =>
            {
                changeMgrArg = e;
            };
            cw.Merge();
            Assert.IsNotNull(changeMgrArg);
            EventArgs changeClearedArg = null;

            cw.ChangeCleared += (o, e) =>
            {
                changeClearedArg = e;
            };
            cw.Clear();
            Assert.IsNotNull(changeClearedArg);
        }
コード例 #2
0
 public void SavableChange()
 {
     changeWatcher.Clear();
     for (int i = 0; i < LoopCount; i++)
     {
         root["DbConnections:Mysql:Connection" + i] = i.ToString();
     }
     changeWatcher.Merge();
 }