public static MinerOptionsPackage InitInternalsHelper(string pluginRoot, MinerOptionsPackage minerOptionsPackage) { var pluginRootIntenrals = Path.Combine(pluginRoot, "internals"); var minerOptionsPackagePath = Path.Combine(pluginRootIntenrals, "MinerOptionsPackage.json"); var fileMinerOptionsPackage = ReadFileSettings <MinerOptionsPackage>(minerOptionsPackagePath); if (fileMinerOptionsPackage != null && fileMinerOptionsPackage.UseUserSettings) { return(fileMinerOptionsPackage); } else { WriteFileSettings(minerOptionsPackagePath, minerOptionsPackage); return(null); } }
/// <summary> /// InitInternalsHelper checks if there is MinerOptionsPackage json file and returns MinerOptionsPackage <see cref="MinerOptionsPackage"/> from it /// If file doesn't exist or UseUserSettings equals false, the new file is generated with settings from parameter <paramref name="minerOptionsPackage"/> /// </summary> /// <param name="pluginRoot">Represents root path of plugin</param> /// <param name="minerOptionsPackage">Represents MinerOptionsPackage that will be written to file if the file doesn't exist and UseUserSettings equals false</param> public static MinerOptionsPackage InitInternalsHelper(string pluginRoot, MinerOptionsPackage minerOptionsPackage) { return(InitInternalSetting(pluginRoot, minerOptionsPackage, "MinerOptionsPackage.json")); }