using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Windows.Forms;
using ChuPiao.Common.Utils;

namespace ChuPiao.AutoPrint.Configuration
{
    public class MachineXmlConfig
    {
        private static string configPath = Path.Combine(Application.StartupPath, "configs/machineconfig.xml");

        public static List<MachineXmlEntity> GetMachineList()
        {
            List<MachineXmlEntity> list = new List<MachineXmlEntity>();

            if (File.Exists(configPath))
            {
                list = XMLHelper.XmlFileDeserialize<List<MachineXmlEntity>>(configPath);
            }

            return list;
        }

        public static void SaveMachineList(List<MachineXmlEntity> list)
        {
            XMLHelper.XmlFileSerialize(list, configPath);
        }
    }
}
