Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 6dab0250

Přidáno uživatelem Jakub Šilhavý před více než 2 roky(ů)

re #9566 Moved magic values into the configuration file.

Zobrazit rozdíly:

ld_client/LDClient/utils/ConfigLoader.cs
1
using LDClient.utils.loggers;
1
using System.Runtime.InteropServices;
2
using LDClient.utils.loggers;
2 3
using Microsoft.Extensions.Configuration;
3 4

  
4 5
namespace LDClient.utils {
......
15 16
        public int LogChunkSize { get; private set; }
16 17
        public int LogChunkMaxCount { get; private set; }
17 18
        public int LogArchiveMaxCount { get; private set; }
18

  
19 19
        public int LogCleanupPeriod { get; private set; }
20 20
        public LogVerbosity LogVerbosityType { get; private set; } = LogVerbosity.Full;
21 21
        public LogFlow LogFlowType { get; private set; } = LogFlow.Console;
......
43 43
        public string T32ProcessName { get; private set; }
44 44
        public uint DetectionPeriod { get; private set; }
45 45
        public string T32InfoLocation { get; private set; }
46
        public string F32RemExecutable { get; private set; }
47
        public string F32RemArguments { get; private set; }
48
        public uint FetchInfoMaxAttempts { get; private set;  }
49
        public uint FetchInfoAttemptPeriod { get; private set; }
50
        
46 51
        #endregion
47 52

  
48 53
        public ConfigLoader() {
......
68 73
                ApiBaseAddress = network["ApiBaseAddress"];
69 74
                ApiUsbEndPoint = network["ApiLDEndPoint"];
70 75
                ApiPort = uint.Parse(network["ApiPort"]);
71

  
72

  
76
                
73 77
                var cache = configuration.GetSection(CacheSection);
74 78
                RetryPeriod = uint.Parse(cache["RetryPeriod"]);
75 79
                MaxEntries = uint.Parse(cache["MaxEntries"]);
76 80
                MaxRetries = uint.Parse(cache["MaxRetries"]);
77 81
                CacheFileName = cache["CacheFileName"];
78

  
79

  
82
                
80 83
                var debugger = configuration.GetSection(DdSection);
81 84
                T32ProcessName = debugger["T32ProcessName"];
82 85
                T32InfoLocation = debugger["T32InfoLocation"];
83 86
                DetectionPeriod = uint.Parse(debugger["DetectionPeriod"]);
87
                F32RemExecutable = debugger["F32RemExecutable"];
88
                F32RemArguments = debugger["F32RemArguments"];
89
                FetchInfoMaxAttempts = uint.Parse(debugger["FetchInfoMaxAttempts"]);
90
                FetchInfoAttemptPeriod = uint.Parse(debugger["FetchInfoAttemptPeriod"]);
84 91

  
85 92
                Console.WriteLine("Configuration successfully loaded!");
86 93
            } catch (FormatException e) {

Také k dispozici: Unified diff