public void ReadConfigFromFile() { EnsurePathAndFile(); string json = File.ReadAllText(this.fullPath); this.productVolume = JsonConvert.DeserializeObject <ProductVolume>(json); if (this.productVolume == null) { this.productVolume = new ProductVolume(); this.productVolume.GeoDisVolume = 1; this.productVolume.TorrentVolume = 1; this.productVolume.WaterloggingVolume = 1; } }
public ProductVolumeConfig() { this.fullPath = Path.Combine(Directory.GetCurrentDirectory(), dir, pathConfigFileName); this.productVolume = new ProductVolume(); ReadConfigFromFile(); }