Example #1
0
        /// <inheritdoc />
        public void ReadFile()
        {
            if (!CheckIfFileExistsAndCreate())
            {
                _isLoaded = true;
                return;
            }

            string json = string.Empty;

            using (var sr = _file.OpenText())
            {
                json = sr.ReadToEnd();
            }
            if (!string.IsNullOrWhiteSpace(json))
            {
                if (_cryptoProvider != null)
                {
                    json = _cryptoProvider.Decryptor(json);
                }
                _configurations = JsonConvert.DeserializeObject <Dictionary <string, string> >(json);
            }
            _isLoaded = true;
        }