Esempio n. 1
0
        public void UIContextSaveTest()
        {
            TestClass tc = new TestClass
            {
                Id     = 1,
                Name   = "Good",
                Remark = "Hello"
            };

            UIContext context = new UIContext(tc);

            context.LoadContext("Name=GG;Remark=HH");
            Assert.AreEqual(tc.Name, "GG");
            Assert.AreEqual(tc.Remark, "HH");
            context.Save();

            TestStringId tsi = new TestStringId
            {
                MyList    = { "GGG", "HHH", "IIII" },
                SubObject = new TestClass {
                    Name = "ThisSub"
                },

                MyPos  = new System.Drawing.Point(1, 2),
                MySize = new System.Drawing.Size(200, 300)
            };

            UIContext context1 = new UIContext(tsi);

            context1.LoadContext("MyList;SubObject.Name;MySize;MyPos");
            tsi.SubObject.Name = "ThatSub";
            context1.Save(true);
        }