C# Класс Nexus.Client.Mods.Formats.OMod.OMod

Encapsulates a OMod mod archive.
Наследование: ObservableObject, IMod
Показать файл Открыть проект

Открытые методы

Метод Описание
BeginReadOnlyTransaction ( FileUtil p_futFileUtil ) : void

Starts a read-only transaction.

This puts the OMod into read-only mode. Read-only mode can greatly increase the speed at which multiple file are extracted.

ContainsFile ( string p_strPath ) : bool

Determines if the OMod contains the given file.

EndReadOnlyTransaction ( ) : void

Ends a read-only transaction.

This takes the OMod out of read-only mode. Read-only mode can greatly increase the speed at which multiple file are extracted.

GetFile ( string p_strFile ) : byte[]

Retrieves the specified file from the OMod.

GetFileList ( ) : List

Retrieves the list of files in this OMod.

GetFileList ( string p_strFolderPath, bool p_booRecurse ) : List

Retrieves the list of all files in the specified OMod folder.

IsMatchingVersion ( ) : bool

Determines if last known version is the same as the current version.

OMod ( string p_strFilePath, OModFormat p_mftModFormat, IModCacheManager p_mcmModCacheManager, IScriptTypeRegistry p_stgScriptTypeRegistry ) : System

A simple constructor that initializes the OMod from the specified file.

ToString ( ) : string

Uses the mod name to represent to mod.

UpdateInfo ( IModInfo p_mifInfo, bool p_booOverwriteAllValues ) : void

Updates the object's properties to the values of the given IModInfo.

Защищенные методы

Метод Описание
DeleteSpecialFile ( string p_strPath ) : void

Deletes the specified file.

ExtractConfig ( SevenZip.SevenZipExtractor p_szeOmod ) : void

Loads the mod metadata from the config file.

ExtractDataFileList ( SevenZip.SevenZipExtractor p_szeOmod ) : void

Loads the list of data files in the mod.

ExtractPluginList ( SevenZip.SevenZipExtractor p_szeOmod ) : void

Loads the list of plugins in the mod.

FindPathPrefix ( ) : void

This finds where in the archive the FOMod file structure begins.

This methods finds the path prefix to the folder containing the core files and folders of the FOMod. If there are any files that are above the core folder, than they are given new file names inside the core folder.

GetRealPath ( string p_strPath ) : string

This method adjusts the given virtual path to the actual path to the file in the mod.

This method account for the virtual restructuring of the mod file structure performed by FindPathPrefix().

GetSpecialFile ( string p_strFile ) : byte[]

Retrieves the specified file from the OMod.

LoadInfo ( byte p_bteData ) : void

Deserializes an IModInfo from the given data.

ReplaceSpecialFile ( string p_strPath, byte p_bteData ) : void

Replaces the specified file with the given data.

ReplaceSpecialFile ( string p_strPath, string p_strData ) : void

Replaces the specified file with the given text.

SaveInfo ( ) : byte[]

Serializes this IModInfo to a data block, suitable to write to a file.

ValidateConfig ( byte p_bteData ) : bool

Validates an OMod config file.

Приватные методы

Метод Описание
ArchiveFile_ReadOnlyInitProgressUpdated ( object sender, CancelProgressEventArgs e ) : void

Handles the Archive.ReadOnlyInitProgressUpdated event of the mod's archive file.

This raises the mod's ReadOnlyInitProgressUpdated event.

Archive_FilesChanged ( object sender, EventArgs e ) : void

Handles the Archive.FilesChanged event of the FOMod's archive.

This ensures that the path prefix that points to the folder in the archive that contains the core files and folders of the FOMod is updated when the archive changes.

InitializePackedOmod ( IScriptTypeRegistry p_stgScriptTypeRegistry ) : void

Initializes an OMod in packed format.

InitializeUnpackedOmod ( bool p_booUseCache, IModCacheManager p_mcmModCacheManager, IScriptTypeRegistry p_stgScriptTypeRegistry ) : void

Initializes an OMod in OMod-ready archive format.

UpdateFileStreamExtractionProgress ( float p_fltPercentDone ) : void

Updates the progress of the read only initialization while extracting file blocks.

UpdateReadOnlyInitProgress ( float p_fltBasePercent, float p_fltPercentBlockSize, float p_fltPercentDone ) : void

Updates the progress of the read only initialization.

dpwWatcher_ProgressUpdated ( object sender, EventArgs e ) : void

Handles the DecoderProgressWatcher.ProgressUpdated event of the watcher that is monitoring the extraction of compressed files blocks.

szeZip_Extracting ( object sender, SevenZip.ProgressEventArgs e ) : void

Handles the SevenZipExtractor.Extracting event of the extractor that is extracting the compressed files blocks.

Описание методов

BeginReadOnlyTransaction() публичный Метод

Starts a read-only transaction.
This puts the OMod into read-only mode. Read-only mode can greatly increase the speed at which multiple file are extracted.
public BeginReadOnlyTransaction ( FileUtil p_futFileUtil ) : void
p_futFileUtil Nexus.Client.Util.FileUtil
Результат void

ContainsFile() публичный Метод

Determines if the OMod contains the given file.
public ContainsFile ( string p_strPath ) : bool
p_strPath string The filename whose existence in the OMod is to be determined.
Результат bool

DeleteSpecialFile() защищенный Метод

Deletes the specified file.
protected DeleteSpecialFile ( string p_strPath ) : void
p_strPath string The path of the file to delete.
Результат void

EndReadOnlyTransaction() публичный Метод

Ends a read-only transaction.
This takes the OMod out of read-only mode. Read-only mode can greatly increase the speed at which multiple file are extracted.
public EndReadOnlyTransaction ( ) : void
Результат void

ExtractConfig() защищенный Метод

Loads the mod metadata from the config file.
protected ExtractConfig ( SevenZip.SevenZipExtractor p_szeOmod ) : void
p_szeOmod SevenZip.SevenZipExtractor The extractor from which to read the config file.
Результат void

ExtractDataFileList() защищенный Метод

Loads the list of data files in the mod.
protected ExtractDataFileList ( SevenZip.SevenZipExtractor p_szeOmod ) : void
p_szeOmod SevenZip.SevenZipExtractor The extractor from which to read the file list.
Результат void

ExtractPluginList() защищенный Метод

Loads the list of plugins in the mod.
protected ExtractPluginList ( SevenZip.SevenZipExtractor p_szeOmod ) : void
p_szeOmod SevenZip.SevenZipExtractor The extractor from which to read the plugin list.
Результат void

FindPathPrefix() защищенный Метод

This finds where in the archive the FOMod file structure begins.
This methods finds the path prefix to the folder containing the core files and folders of the FOMod. If there are any files that are above the core folder, than they are given new file names inside the core folder.
protected FindPathPrefix ( ) : void
Результат void

GetFile() публичный Метод

Retrieves the specified file from the OMod.
Thrown if the specified file /// is not in the OMod.
public GetFile ( string p_strFile ) : byte[]
p_strFile string The file to retrieve.
Результат byte[]

GetFileList() публичный Метод

Retrieves the list of files in this OMod.
public GetFileList ( ) : List
Результат List

GetFileList() публичный Метод

Retrieves the list of all files in the specified OMod folder.
public GetFileList ( string p_strFolderPath, bool p_booRecurse ) : List
p_strFolderPath string The OMod folder whose file list is to be retrieved.
p_booRecurse bool Whether to return files that are in subdirectories of the given directory.
Результат List

GetRealPath() защищенный Метод

This method adjusts the given virtual path to the actual path to the file in the mod.
This method account for the virtual restructuring of the mod file structure performed by FindPathPrefix().
protected GetRealPath ( string p_strPath ) : string
p_strPath string The path to adjust.
Результат string

GetSpecialFile() защищенный Метод

Retrieves the specified file from the OMod.
Thrown if the specified file /// is not in the OMod.
protected GetSpecialFile ( string p_strFile ) : byte[]
p_strFile string The file to retrieve.
Результат byte[]

IsMatchingVersion() публичный Метод

Determines if last known version is the same as the current version.
public IsMatchingVersion ( ) : bool
Результат bool

LoadInfo() защищенный Метод

Deserializes an IModInfo from the given data.
protected LoadInfo ( byte p_bteData ) : void
p_bteData byte The data from which to deserialize the .
Результат void

OMod() публичный Метод

A simple constructor that initializes the OMod from the specified file.
public OMod ( string p_strFilePath, OModFormat p_mftModFormat, IModCacheManager p_mcmModCacheManager, IScriptTypeRegistry p_stgScriptTypeRegistry ) : System
p_strFilePath string The mod file from which to create the OMod.
p_mftModFormat OModFormat The format of the mod.
p_mcmModCacheManager IModCacheManager The manager for the current game mode's mod cache.
p_stgScriptTypeRegistry IScriptTypeRegistry The registry of supported script types.
Результат System

ReplaceSpecialFile() защищенный Метод

Replaces the specified file with the given data.
protected ReplaceSpecialFile ( string p_strPath, byte p_bteData ) : void
p_strPath string The path of the file to replace.
p_bteData byte The new file data.
Результат void

ReplaceSpecialFile() защищенный Метод

Replaces the specified file with the given text.
protected ReplaceSpecialFile ( string p_strPath, string p_strData ) : void
p_strPath string The path of the file to replace.
p_strData string The new file text.
Результат void

SaveInfo() защищенный Метод

Serializes this IModInfo to a data block, suitable to write to a file.
protected SaveInfo ( ) : byte[]
Результат byte[]

ToString() публичный Метод

Uses the mod name to represent to mod.
public ToString ( ) : string
Результат string

UpdateInfo() публичный Метод

Updates the object's properties to the values of the given IModInfo.
public UpdateInfo ( IModInfo p_mifInfo, bool p_booOverwriteAllValues ) : void
p_mifInfo IModInfo The whose values /// are to be used to update this object's properties.
p_booOverwriteAllValues bool Whether to overwrite the current info values, /// or just the empty ones.
Результат void

ValidateConfig() защищенный Метод

Validates an OMod config file.
protected ValidateConfig ( byte p_bteData ) : bool
p_bteData byte The OMod config file.
Результат bool