Beispiel #1
0
 private void Init()
 {
     lock (_locker) {
         if (!_isInited)
         {
             string json = HomePath.ReadGpuProfilesJsonFile();
             if (!string.IsNullOrEmpty(json))
             {
                 GpuProfilesJsonDb data = VirtualRoot.JsonSerializer.Deserialize <GpuProfilesJsonDb>(json);
                 if (data != null)
                 {
                     _data = data;
                 }
                 else
                 {
                     Save();
                 }
             }
             else
             {
                 Save();
             }
             _isInited = true;
         }
     }
 }
Beispiel #2
0
        protected override void Init()
        {
            string json = HomePath.ReadGpuProfilesJsonFile();

            if (!string.IsNullOrEmpty(json))
            {
                GpuProfilesJsonDb data = VirtualRoot.JsonSerializer.Deserialize <GpuProfilesJsonDb>(json);
                if (data != null)
                {
                    if (!IsGpusModified(data.Gpus))
                    {
                        _data = data;
                    }
                    else
                    {
                        if (data.GpuProfiles.Any())
                        {
                            VirtualRoot.ThisLocalWarn(nameof(GpuProfileSet), "检测到本机显卡发生过变更,请重新填写超频数据。", OutEnum.Warn);
                        }
                        Save();
                    }
                }
                else
                {
                    Save();
                }
            }
            else
            {
                Save();
            }
        }
Beispiel #3
0
        protected override void Init()
        {
            string json = HomePath.ReadGpuProfilesJsonFile();

            if (!string.IsNullOrEmpty(json))
            {
                GpuProfilesJsonDb data = VirtualRoot.JsonSerializer.Deserialize <GpuProfilesJsonDb>(json);
                if (data != null)
                {
                    _data = data;
                }
                else
                {
                    Save();
                }
            }
            else
            {
                Save();
            }
        }