using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XKRS.Common.Model.Helper;

namespace XKRS.UI.Main
{
    public static class SampleHelper
    {




        /// <summary>
        /// 初始化配置数据
        /// </summary>
        public static void Init()
        {
            bool settingChecked = false;

            while (!settingChecked)
            {
                if (settingChecked)
                {
                    Environment.Exit(1);
                }
                //设置目录
                string myDoc = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                var retPath = Path.Combine(myDoc, "A020");
                //将配置文件写入文件
                string defaultSetting = "{\"ProcessCodes\":[],\"ProductionCodes\":[\"Default\"],\"DefaultProcess\":\"A020\",\"DefaultProduction\":\"\",\"ConfigPath\":\""
                    +Path.Combine(retPath, "Configs").Replace("\\", "\\\\")
                    + "\",\"Description\":\"振动盘供料缺陷检测系统\",\"IconPath\":null,\"CurrLayout\":\"Default\",\"IsMinimumWhenClose\":false}";
                SettingHelper.InitWithContent(defaultSetting);
            }
        }
    }
}
