Пример #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            var a1 = new { tyn = (UInt16)12, jj = "test111" };
            var a2 = new { rnh = (UInt16)12, rttr = button1 };

            TT t = new TT();
            t.St = new List<string>() { "iii", "hyiy" };
            t.Anon1 = new List<object>() { a1, a2 };
            t.Anon2 = new List<object>() { a2, a1 };
            t.TA = new DataTable("patients_tName", "tabNsp");
            t.TA.Columns.Add("name");
            t.TA.Columns.Add("id", typeof(Button));
            t.TA.Rows.Add("sam", button1);
            t.TA.Rows.Add("mark", button2);
            t.TA.Rows.Add("mareek", button2);
            t.DS = new DataSet("uuu");
            t.DS.Tables.Add(t.TA);
            //   var wtw = (Button)t.TA.Rows[1][1];
            TB b = new TB();
            b.ttest = "1";
            TB B = new TB();
            B.ttest = "2";
            t.TB1 = b;
            t.TB2 = Tuple.Create(11, b);
            t.TB3 = new List<Tuple<int, TB>>() { t.TB2 };
            //   t.Save();
            t.D_str_TB = new SortedList<string, TB>();
            t.DDS = new List<DataSet>() { t.DS };
            string tt = t.D_str_TB.GetType().FullName;
            t.D_str_TB.Add("ku", b);
            Dictionary<string, TB> D_s_TB = new Dictionary<string, TB>();
            D_s_TB.Add("oo", B);
            t.AR = new Dictionary<string, TB>[2] { D_s_TB, D_s_TB };
            t.AAR = new List<Dictionary<string, TB>[]> { t.AR };
            t.DD = new Dictionary<SortedList<string, TB>, TB>();
            t.DD.Add(t.D_str_TB, b);
            t.L = new List<Dictionary<string, TB>>();
            // t.L.Add(t.D_str_TB);
            t.L.Add(D_s_TB);
            t.l1 = t.L;
            t.l2 = t.L;
            t.ll = new List<List<Dictionary<string, TB>>>();
            t.ll.Add(t.L);
            t.GetCache().Init();//Save();
            var ww = t.GetCache();
            string ert = t.GetCache().ToSerializableString();
            t.Save();
            t.LoadData();
            TT t2 = new TT();
            // t2.GetCache().FromSerializableString(ert);
            t2.LoadData();
            Debug_.Debug.InitF(2, 1);
            Debug_.Debug.Print(t2.GetCache().ToString(), 1);
            Debug_.Debug.Print(t.GetCache().ToString(), 0);
        }