示例#1
0
 private void SaveSysSetting(bool SkipControl = false)
 {
     try
     {
         if (!SkipControl)
         {
             m_SysParam = (SysParams)propertyGrid_SysParam.SelectedObject;
         }
         JsonAccess.Write <SysParams>(m_SysParamFilePath, m_SysParam);
     }
     catch (Exception ex)
     {
         MessageBox.Show($"保存参数失败,异常信息:\r\n{ex.Message}");
     }
 }
示例#2
0
        public void LoadSysSetting(bool SkipControl = false)
        {
            try
            {
                m_SysParam = JsonAccess.Read <SysParams>(m_SysParamFilePath);
                if (m_SysParam == null)
                {
                    m_SysParam = new SysParams();
                    SaveSysSetting(true);
                }

                if (!SkipControl)
                {
                    propertyGrid_SysParam.SelectedObject = m_SysParam;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show($"加载参数失败,异常信息:\r\n{ex.Message}");
            }
        }