Ejemplo n.º 1
0
        /// <summary>
        /// Button_7_Click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_7_Click(object sender, RoutedEventArgs e)
        {
            Debug.WriteLine("Button_7_Click");

            Data dataX = new Data()
            {
                Id = 888, Name = "Xxxx"
            };

            LST.SaveClassToXml <Data>(dataX, "CDatas.xml");
            Debug.WriteLine("Save data to CDatas.xml");
            LST.LoadClassFromXml <Data>(ref dataX, "CDatas.xml");
            Debug.WriteLine("Load data from CDatas.xml Id={0} Name={1}", dataX.Id, dataX.Name);

            Data dataJ = new Data()
            {
                Id = 999, Name = "Jjjj"
            };

            LST.SaveClassToJson <Data>(dataJ, "CDatas.json");
            Debug.WriteLine("Save data to CDatas.json");
            LST.LoadClassFromJson <Data>(ref dataJ, "CDatas.json");
            Debug.WriteLine("Load data from CDatas.json Id={0} Name={1}", dataJ.Id, dataJ.Name);
        }