C# Class SIL.FieldWorks.Common.FwUtils.FwDirectoryFinder

This class is used to find files and directories for FW apps.
Datei anzeigen Open project: sillsdev/FieldWorks Class Usage Examples

Public Methods

Method Description
GetCodeFile ( string filename ) : string

Get a file in the FW code directory.

GetCodeSubDirectory ( string subDirectory ) : string

Get a sub directory of the FW code directory, or return a tidied up version of the original path, if it is not in the FW code folder structure.

GetDataSubDirectory ( string subDirectory ) : string

Get a sub directory of the FW data directory, or return a tidied up version of the original path, if it is not in the FW data folder structure.

GetKeyTermsLocFilename ( string locale ) : string

Returns the file name containing the localization of the key terms list for the given ICU locale.

GetLocaleFromKeyTermsLocFile ( string locFilename ) : string

Extracts the locale identifier (string) from a key terms localization file name.

IsSubFolderOfProjectsDirectory ( string path ) : bool

Determines whether the given path is a direct sub folder of the projects directory. (This is typically true for the a project-specific folder.)

Private Methods

Method Description
ExeOrDllPath ( string file ) : string

Gets the full path of the requested executable/dll file in the folder from which FW is being executed.

GetDirectory ( RegistryKey registryKey, string registryValue, string defaultDir ) : string

Gets a subdirectory of FieldWorks either by reading the registryValue or by getting defaultDir. Will not return null.

GetDirectory ( string registryValue, string defaultDir ) : string

Gets a subdirectory of FieldWorks either by reading the registryValue or by getting defaultDir. Will not return null.

GetDirectoryLocalMachine ( string registryValue, string defaultDir ) : string

Get a directory for a particular key ignoring current user settings.

GetFLExBridgeFolderPath ( ) : string
GetSubDirectory ( string directory, string subDirectory ) : string

Get a sub directory of the given directory, or return a tidied up version of the original path, if it is not in the FW code folder structure.

Method Details

GetCodeFile() public static method

Get a file in the FW code directory.
public static GetCodeFile ( string filename ) : string
filename string examples: "iso-8859-1.tec"
return string

GetCodeSubDirectory() public static method

Get a sub directory of the FW code directory, or return a tidied up version of the original path, if it is not in the FW code folder structure.
public static GetCodeSubDirectory ( string subDirectory ) : string
subDirectory string examples: "WW\XAMPLE or \WW\XAMPLE"
return string

GetDataSubDirectory() public static method

Get a sub directory of the FW data directory, or return a tidied up version of the original path, if it is not in the FW data folder structure.
public static GetDataSubDirectory ( string subDirectory ) : string
subDirectory string examples: "Languages or \Languages"
return string

GetKeyTermsLocFilename() static public method

Returns the file name containing the localization of the key terms list for the given ICU locale.
static public GetKeyTermsLocFilename ( string locale ) : string
locale string
return string

GetLocaleFromKeyTermsLocFile() static public method

Extracts the locale identifier (string) from a key terms localization file name.
static public GetLocaleFromKeyTermsLocFile ( string locFilename ) : string
locFilename string
return string

IsSubFolderOfProjectsDirectory() public static method

Determines whether the given path is a direct sub folder of the projects directory. (This is typically true for the a project-specific folder.)
public static IsSubFolderOfProjectsDirectory ( string path ) : bool
path string The path.
return bool