Represents JSON configuration data for a Geosite (e.g. from a "region.json" file)
Inheritance: JsonData
Exemple #1
0
 /// <summary>
 /// Create a Geosite object by loading the "region.json" file and enumerating plug-ins, using the specified paths.
 /// </summary>
 public static Geosite LoadSiteData(string regionJsonFilePath, string pluginsFolderPath, string appDataFolderPath)
 {
     var jsonDataRegion = new JsonDataRegion(appDataFolderPath).LoadFile(regionJsonFilePath);
     var pluginFolderPaths = Directory.EnumerateDirectories(pluginsFolderPath);
     var pluginConfigData = GetPluginConfigurationData(pluginFolderPaths, appDataFolderPath);
     var pluginFolderNames = pluginFolderPaths.Select(p => Path.GetFileName(p)).ToList();
     var geosite = new Geosite(jsonDataRegion, pluginFolderNames, pluginConfigData);
     return geosite;
 }
 /// <summary>
 /// Create a Geosite object by loading the "region.json" file and enumerating plug-ins, using the specified paths.
 /// </summary>
 public static Geosite LoadSiteData(string regionJsonFilePath, string basePath, string appDataFolderPath)
 {
     var jsonDataRegion = new JsonDataRegion(appDataFolderPath).LoadFile(regionJsonFilePath);
     var pluginDirectories = PluginLoader.GetPluginDirectories(jsonDataRegion, basePath);
     PluginLoader.VerifyDirectoriesExist(pluginDirectories);
     var pluginFolderPaths = pluginDirectories.SelectMany(path => Directory.EnumerateDirectories(path));
     var pluginConfigData = GetPluginConfigurationData(pluginFolderPaths, appDataFolderPath);
     var pluginFolderNames = pluginFolderPaths.Select(path => PluginLoader.GetPluginFolderPath(basePath, path)).ToList();
     var pluginModuleNames = pluginFolderPaths.Select(path => PluginLoader.GetPluginModuleName(basePath, path)).ToList();
     var geosite = new Geosite(jsonDataRegion, pluginFolderNames, pluginModuleNames, pluginConfigData);
     return geosite;
 }