Exemplo n.º 1
0
        public void LoadConf(ConfTree conf, string oplevel)
        {
            if (Conf == null || !Conf.Equals(conf))
            {
                _log.Debug($"Load ConfTree({conf.Name},{(oplevel != null ? "" : "null")})");

                Conf = conf;
                DGV_ConfigItems.DataSource = UiSupport.ConvertToTable(Conf, oplevel);
                DGV_ConfigItems.Columns[DGV_ConfigItems.ColumnCount - 1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            }
        }
Exemplo n.º 2
0
        public void TestConfTree_Compare_SimpleTreeEqual()
        {
            ConfTree tree1 = new ConfTree("Tree1");

            tree1.Add(new ConfItem("Item1-1", "Value1-1"));

            ConfTree tree2 = new ConfTree("Tree1");

            tree2.Add(new ConfItem("Item1-1", "Value1-1"));

            Assert.IsTrue(tree1.Equals(tree2));
        }
Exemplo n.º 3
0
        public void TestConfTree_Compare_MixedTree()
        {
            ConfTree a1 = new ConfTree("Tree1");

            a1.Add(new ConfItem("Item1-1", "Value1-1"));
            ConfTree a2 = new ConfTree("Tree2");

            a2.Add(new ConfItem("Item2-1", "Value2-1"));
            a2.Add(new ConfItem("Item2-2", "Value2-2"));
            a1.Add(a2);

            ConfTree b1 = new ConfTree("Tree1");

            b1.Add(new ConfItem("Item1-1", "Value1-1"));
            ConfTree b2 = new ConfTree("Tree2");

            b2.Add(new ConfItem("Item2-1", "Value2-1"));
            b2.Add(new ConfItem("Item2-2", "Value2-2"));
            b1.Add(b2);

            Assert.IsTrue(a1.Equals(b1));
        }