public MainForm(IStockService stockService)
            : this()
        {
            _stockService = stockService;
            _configInfo = _stockService.GetConfigEntity();

            ModifyComponent();
            InitializeEvent();
            InitStockData();
        }
        public ConfigInfo GetConfigEntity()
        {
            var configInfo = _settingRepository.GetConfigEntity();

            if (configInfo == null)
            {
                configInfo = new ConfigInfo()
               {
                   ShowHeaderSetting = typeof(StockInfo).GetProperties()
                                                             .Select(propertyInfo =>
                                                             {
                                                                 var showDescriptionAttribute = propertyInfo.GetCustomAttributes(typeof(ShowDescriptionAttribute), false).FirstOrDefault() as ShowDescriptionAttribute;
                                                                 if (showDescriptionAttribute != null)
                                                                 {
                                                                     return new ShowDescriptionEntity
                                                                     {
                                                                         IsShow = showDescriptionAttribute.IsShow,
                                                                         Description = showDescriptionAttribute.Description,
                                                                         PropertyName = propertyInfo.Name
                                                                     };
                                                                 }
                                                                 return null;
                                                             })
                                                             .Where(x => x != null)
                                                             .ToList(),

                   WindowWidth = 605,
                   WindowHeight = 190,
                   WindowOpacity = 100,
                   WindowTop = true
               };

                _settingRepository.SaveConfigEntity(configInfo);
            }

            return configInfo;
        }
        public bool SaveConfigEntity(ConfigInfo configInfo)
        {
            if (configInfo == null) { return false; }

            return _settingRepository.SaveConfigEntity(configInfo);
        }