C# Class ACAT.Lib.Core.Utility.FileUtils

Contains functions to contruct paths relative to the various root folders in ACAT such as the Assets folder, the User folder, the Profile folder, the Extensions folder etc.
Show file Open project: brlima94/acat-localization

Public Methods

Method Description
AssemblyResolve ( Assembly executingAssembly, ResolveEventArgs args ) : Assembly
CheckAppExistingInstance ( String mutexName ) : bool

Checks if the app is already running. The mutex is used to check this

ConvertMappedFileNameToDosFileName ( String mappedFileName ) : String

Converts a filename from the \\Device\\HarddiskVolume1\\....\\abc.exe format to a Dos file name

Copy ( String source, String target ) : bool

Copies the spcified source to target. IF source is a folder, recursively copies source to target

CopyDir ( string srcDir, string targetDir, bool recursive ) : bool

Copies the specified source dir to the target dir

Dispose ( ) : void

Not used

GetAssetsDir ( ) : String

Returns fully qualified path to ACAT assets

GetConfigFileFullPath ( String xmlFileName ) : String

Returns the fully qualified name of the XML config file.

GetDependentAssemblyVersion ( Assembly assembly ) : void

Gets version of assembly and referenced assemblies

GetExtensionDir ( ) : String

Returns fully qualified path to the Extensions root folder

GetExtensionDir ( String dir ) : String

Returns fully qualified path of the specified dir relative to to the Extensions root folder

GetFileAssociationForExtension ( string extension ) : string

Returns the path to the executable that is associated with the file extension

GetFontsDir ( ) : String

Returns the fully qualified path to the global ACAT fonts folder

GetImagePath ( string imageFile ) : String

Returns the fully qualified path to the specified image file. First checks the User's image folder. If it doesn't find the file there, returns the path to the global ACAT images folder

GetImagesDir ( ) : String

Returns fully qualified path to the global ACAT Images folder

GetLocalizedFilePath ( String preferredFilePath ) : String

Returns the path to an localized version of the file, if it exists, using the pattern "[filename].[culture_name].[extension]".

GetLogsDir ( ) : String

Returns path to where ACAT log files will be stored

GetMappedFileName ( IntPtr hModule ) : String

Returns the mapped file name of a memory mapped file

GetPreferencesFileFullPath ( String prefName ) : String

Returns the fully qualified name of the preferences file. The location of the file is the same as the EXE

GetSkinsDir ( ) : String

Returns the global ACAT themes folder

GetSkinsImagePath ( string skin, string imageFile ) : String

For the specified imaagefile, gets the fully qualified path to it for the spcified skin

GetSoundPath ( string soundFile ) : String

Returns the fully qualified path to the specified sound file. First checks the User's sounds folder. If it doesn't find the file there, returns the path to the global ACAT sounds folder

GetSoundsDir ( ) : String

Returns the global ACAT sounds folder

GetUserFontsDir ( ) : String

Returns fully qualified path to the Fonts folder relative to the current user's User folder

GetUserImageDir ( ) : String

Returns fully qualified path to the Images folder relative to the current user's User folder

GetUserSkinsDir ( ) : String

Returns path to the themes folder relative to the current user's USER folder

GetUserSoundsDir ( ) : String

Returns the sounds folder relative to the current user's USER folder

GetUsersDir ( ) : String

Returns fully qualified path to the Users folders

IsACATRunning ( ) : bool

Returns true if an instance of any of the ACAT apps is still running

Private Methods

Method Description
AssocQueryString ( uint flags, uint str, string pszAssoc, string pszExtra, [ pszOut, [ pcchOut ) : uint
IsRunning ( String processName ) : bool
Run ( String executable ) : bool
closeAppMutex ( ) : void

Closes the application mutex

copyDir ( string srcDir, string targetDir, bool recursive ) : void

Recursively copies source dir to target

Method Details

AssemblyResolve() public static method

public static AssemblyResolve ( Assembly executingAssembly, ResolveEventArgs args ) : Assembly
executingAssembly System.Reflection.Assembly
args System.ResolveEventArgs
return System.Reflection.Assembly

CheckAppExistingInstance() public static method

Checks if the app is already running. The mutex is used to check this
public static CheckAppExistingInstance ( String mutexName ) : bool
mutexName String name of the mutex
return bool

ConvertMappedFileNameToDosFileName() public static method

Converts a filename from the \\Device\\HarddiskVolume1\\....\\abc.exe format to a Dos file name
public static ConvertMappedFileNameToDosFileName ( String mappedFileName ) : String
mappedFileName String input mapped file name
return String

Copy() public static method

Copies the spcified source to target. IF source is a folder, recursively copies source to target
public static Copy ( String source, String target ) : bool
source String source file or dir
target String target
return bool

CopyDir() public static method

Copies the specified source dir to the target dir
public static CopyDir ( string srcDir, string targetDir, bool recursive ) : bool
srcDir string source dir
targetDir string target dir>
recursive bool go deep recursively?
return bool

Dispose() public static method

Not used
public static Dispose ( ) : void
return void

GetAssetsDir() public static method

Returns fully qualified path to ACAT assets
public static GetAssetsDir ( ) : String
return String

GetConfigFileFullPath() public static method

Returns the fully qualified name of the XML config file.
public static GetConfigFileFullPath ( String xmlFileName ) : String
xmlFileName String xml config file name
return String

GetDependentAssemblyVersion() public static method

Gets version of assembly and referenced assemblies
public static GetDependentAssemblyVersion ( Assembly assembly ) : void
assembly System.Reflection.Assembly input assembly
return void

GetExtensionDir() public static method

Returns fully qualified path to the Extensions root folder
public static GetExtensionDir ( ) : String
return String

GetExtensionDir() public static method

Returns fully qualified path of the specified dir relative to to the Extensions root folder
public static GetExtensionDir ( String dir ) : String
dir String relative path to the extensions folder
return String

GetFileAssociationForExtension() public static method

Returns the path to the executable that is associated with the file extension
public static GetFileAssociationForExtension ( string extension ) : string
extension string file extension
return string

GetFontsDir() public static method

Returns the fully qualified path to the global ACAT fonts folder
public static GetFontsDir ( ) : String
return String

GetImagePath() public static method

Returns the fully qualified path to the specified image file. First checks the User's image folder. If it doesn't find the file there, returns the path to the global ACAT images folder
public static GetImagePath ( string imageFile ) : String
imageFile string
return String

GetImagesDir() public static method

Returns fully qualified path to the global ACAT Images folder
public static GetImagesDir ( ) : String
return String

GetLocalizedFilePath() public static method

Returns the path to an localized version of the file, if it exists, using the pattern "[filename].[culture_name].[extension]".

public static GetLocalizedFilePath ( String preferredFilePath ) : String
preferredFilePath String Path to
return String

GetLogsDir() public static method

Returns path to where ACAT log files will be stored
public static GetLogsDir ( ) : String
return String

GetMappedFileName() public static method

Returns the mapped file name of a memory mapped file
public static GetMappedFileName ( IntPtr hModule ) : String
hModule System.IntPtr handle to the module
return String

GetPreferencesFileFullPath() public static method

Returns the fully qualified name of the preferences file. The location of the file is the same as the EXE
public static GetPreferencesFileFullPath ( String prefName ) : String
prefName String
return String

GetSkinsDir() public static method

Returns the global ACAT themes folder
public static GetSkinsDir ( ) : String
return String

GetSkinsImagePath() public static method

For the specified imaagefile, gets the fully qualified path to it for the spcified skin
public static GetSkinsImagePath ( string skin, string imageFile ) : String
skin string skin name
imageFile string image file name
return String

GetSoundPath() public static method

Returns the fully qualified path to the specified sound file. First checks the User's sounds folder. If it doesn't find the file there, returns the path to the global ACAT sounds folder
public static GetSoundPath ( string soundFile ) : String
soundFile string input sound file name
return String

GetSoundsDir() public static method

Returns the global ACAT sounds folder
public static GetSoundsDir ( ) : String
return String

GetUserFontsDir() public static method

Returns fully qualified path to the Fonts folder relative to the current user's User folder
public static GetUserFontsDir ( ) : String
return String

GetUserImageDir() public static method

Returns fully qualified path to the Images folder relative to the current user's User folder
public static GetUserImageDir ( ) : String
return String

GetUserSkinsDir() public static method

Returns path to the themes folder relative to the current user's USER folder
public static GetUserSkinsDir ( ) : String
return String

GetUserSoundsDir() public static method

Returns the sounds folder relative to the current user's USER folder
public static GetUserSoundsDir ( ) : String
return String

GetUsersDir() public static method

Returns fully qualified path to the Users folders
public static GetUsersDir ( ) : String
return String

IsACATRunning() public static method

Returns true if an instance of any of the ACAT apps is still running
public static IsACATRunning ( ) : bool
return bool