コード例 #1
0
        public ETLRegistrySettings(string path)
        {
            RegistryPath = path;

            string registry = Path.Combine(RegistryPath, "registry.json");

            UpdateSettings(JsonCommon.Load(registry));
        }
コード例 #2
0
        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());
        }
コード例 #3
0
        /// <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);
        }