示例#1
0
        /// <inheritdoc />
        public override void Init(ITorchBase torch)
        {
            base.Init(torch);
            var configFile = Path.Combine(StoragePath, "GridExporter.cfg");

            try {
                _config = Persistent <ExportConfig> .Load(configFile);
            } catch (Exception e) {
                Log.Warn(e);
            }

            if (_config?.Data == null)
            {
                Log.Info("Create Default Config, because none was found!");

                _config = new Persistent <ExportConfig>(configFile, new ExportConfig());
                _config.Save();
            }

            Instance = this;
        }
 public Control(GridExporterPlugin plugin) : this()
 {
     Plugin      = plugin;
     DataContext = plugin.Config;
 }