﻿using System.IO;
using Newtonsoft.Json;

namespace TfsHipChat.Configuration
{
    public class ConfigurationProvider : IConfigurationProvider
    {
        private TfsHipChatConfig _tfsHipChatConfig;

        public TfsHipChatConfig Config
        {
            get
            {
                if (_tfsHipChatConfig == null)
                {
                    using (var reader = new JsonTextReader(new StreamReader(Properties.Settings.Default.DefaultConfigPath)))
                    {
                        _tfsHipChatConfig = (new JsonSerializer()).Deserialize<TfsHipChatConfig>(reader);
                    }
                }

                return _tfsHipChatConfig;
            }
        }
    }
}

﻿using System.IO;
using Newtonsoft.Json;
using TfsHipChat.Properties;

namespace TfsHipChat.Configuration
{
    public class ConfigurationProvider : IConfigurationProvider
    {
        public ConfigurationProvider()
        {
            using (var reader = new JsonTextReader(new StreamReader(Settings.Default.DefaultConfigPath)))
            {
                Config = (new JsonSerializer()).Deserialize<TfsHipChatConfig>(reader);
            }
        }

        public TfsHipChatConfig Config { get; private set; }
    }
}

Remove lazy loading of configuration
Remove lazy loading of configuration
