示例#1
0
        public Settings()
        {
            var full_path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), Name);

            if (File.Exists(full_path))
            {
                Model = JsonConvert.DeserializeObject <SettingModel>(File.ReadAllText(full_path));
            }

            if (Model == null)
            {
                Model = new SettingModel
                {
                    Language    = GetLanguageKey(),
                    ThreadCount = 3,
                    //ThreadCount = Environment.ProcessorCount,
                    PostprocessorThreadCount = 3,

                    NetworkSettings = new SettingModel.NetworkSetting
                    {
                        TimeoutInfinite    = false,
                        TimeoutMillisecond = 10000,
                        DownloadBufferSize = 131072,
                        RetryCount         = 10,
                        UsingProxyList     = false,
                    },
                };
            }
            //Save();
        }
示例#2
0
        public Settings()
        {
            Model = new SettingModel
            {
                Language = GetLanguageKey(),
                //ThreadCount = Environment.ProcessorCount,
                ThreadCount = 3,
                PostprocessorThreadCount = 3,

                NetworkSettings = new SettingModel.NetworkSetting
                {
                    TimeoutInfinite    = false,
                    TimeoutMillisecond = 10000,
                    DownloadBufferSize = 131072,
                    RetryCount         = 10,
                    UsingProxyList     = false,
                },
            };
        }