C# Class GeositeFramework.Helpers.PluginLoader

Afficher le fichier Open project: CoastalResilienceNetwork/GeositeFramework

Méthodes publiques

Méthode Description
GetPluginDirectories ( JsonData jsonDataRegion, string basePath ) : IEnumerable

Return pluginFolders array from region.json. Default value is ["plugins"]

GetPluginFolderPath ( string basePath, string pluginPath ) : string

Return pluginPath relative to basePath. For example, if basePath is "~/www" and pluginPath is "~/www/plugins/xyz" then return "plugins/xyz".

GetPluginModuleName ( string basePath, string pluginPath ) : string

Convert pluginPath to relative module path. For example, if basePath is "~/www" and pluginPath is "~/www/plugins/xyz" then return "tnc/plugins/xyz/main". Assuming "tnc" prefix is a package configured to point to your basePath.

SortPluginNames ( List pluginNames, int>.Func keyFunc ) : void

Sort pluginNames by specified keyFunc. Items for which keyFunc returns -1 (not found) will be sorted towards the end of the list in no particular order.

StripPluginModule ( string pluginModule ) : string

Given a module name like "tnc/plugins/layer_selector/main" return "layer_selector".

VerifyDirectoriesExist ( IEnumerable dirs ) : void

Throw exception if folder does not exist.

Method Details

GetPluginDirectories() public static méthode

Return pluginFolders array from region.json. Default value is ["plugins"]
public static GetPluginDirectories ( JsonData jsonDataRegion, string basePath ) : IEnumerable
jsonDataRegion JsonData
basePath string
Résultat IEnumerable

GetPluginFolderPath() public static méthode

Return pluginPath relative to basePath. For example, if basePath is "~/www" and pluginPath is "~/www/plugins/xyz" then return "plugins/xyz".
public static GetPluginFolderPath ( string basePath, string pluginPath ) : string
basePath string
pluginPath string
Résultat string

GetPluginModuleName() public static méthode

Convert pluginPath to relative module path. For example, if basePath is "~/www" and pluginPath is "~/www/plugins/xyz" then return "tnc/plugins/xyz/main". Assuming "tnc" prefix is a package configured to point to your basePath.
public static GetPluginModuleName ( string basePath, string pluginPath ) : string
basePath string
pluginPath string
Résultat string

SortPluginNames() public static méthode

Sort pluginNames by specified keyFunc. Items for which keyFunc returns -1 (not found) will be sorted towards the end of the list in no particular order.
public static SortPluginNames ( List pluginNames, int>.Func keyFunc ) : void
pluginNames List
keyFunc int>.Func
Résultat void

StripPluginModule() public static méthode

Given a module name like "tnc/plugins/layer_selector/main" return "layer_selector".
public static StripPluginModule ( string pluginModule ) : string
pluginModule string
Résultat string

VerifyDirectoriesExist() public static méthode

Throw exception if folder does not exist.
public static VerifyDirectoriesExist ( IEnumerable dirs ) : void
dirs IEnumerable
Résultat void