public ETLRegistrySettings(string path) { RegistryPath = path; string registry = Path.Combine(RegistryPath, "registry.json"); UpdateSettings(JsonCommon.Load(registry)); }
public ETLSettings(string settings) { JObject data = JsonCommon.Load(settings); string path = data["RegistryPath"].ToString(); path = string.IsNullOrEmpty(path) || !Directory.Exists(path) ? Path.Combine(AppContext.BaseDirectory, "Registry") : path; Registry = new ETLRegistrySettings(path); JWTKey = data["JWTKey"].ToString(); ConnectString = data["Database"].ToString(); Proxy = JsonConvert.DeserializeObject <ETLProxy>(data["Proxy"].ToString()); }
/// <summary> /// Формирование списка миграций /// </summary> private void GetMigrationsList() { migrations = new List <Migration>(); if (string.IsNullOrEmpty(Path)) { return; } FileInfo[] files = new DirectoryInfo(Path).GetFiles("*.json"); foreach (FileInfo file in files) { try { List <Migration> m = JsonCommon.Load <List <Migration> >(file.FullName); ((List <Migration>)migrations).AddRange(m); } catch { } } migrations = migrations.OrderBy(m => m.Version); }