using ryCommon;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VSoft.Config
{
    /// <summary>
    /// 配置类,保存在运行期间会被改变的配置信息(本系统基于乘黄V2架构)
    /// </summary>
    public static class Soft_Config
    {
        /// <summary>
        /// 是否能关闭窗体。
        /// </summary>
        public static bool IsCanCloseForm = true;
        /// <summary>
        /// 在点击主窗口关闭按钮时,隐藏窗体(只有开启了托盘图标,本功能才能生效,此时需要通过托盘图标进行关闭)。
        /// </summary>
        public static bool HideByCloseBtn = true;
        /// <summary>
        /// 显示主窗体的热键
        /// </summary>
        public static string ShowMainHotKey = "";
        /// <summary>
        /// 单击打开软件
        /// </summary>
        public static bool OpenByClick = false;
        /// <summary>
        /// 启动软件后隐藏自身
        /// </summary>
        public static bool HideAfterRun = true;
        public static void LoadSetting()
        {
            ryCommon.Storage Stor = new Storage();
            Stor.LoadFromFile(Soft_Info.UserDataFolder + "\\Setting.xml");
            Stor.SelectNodeBySet();
            ShowMainHotKey = Stor.GetAttrValue("ShowMainHotKey", "1+88");
            OpenByClick = Stor.GetAttrValue("OpenByClick", false);
            HideAfterRun = Stor.GetAttrValue("HideAfterRun", true);
            //low_count = Stor.GetAttrValue("LowCount", 10);
        }
    }
}
