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

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

Защищенные свойства (Protected)

Свойство Тип Описание
IgnoreFolders List

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

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

Starts a read-only transaction.

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

CompareOrderFoldersFirst ( string x, string y ) : int
ContainsFile ( string p_strPath ) : bool

Determines if the FOMod contains the given file.

EndReadOnlyTransaction ( ) : void

Ends a read-only transaction.

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

FOMod ( string p_strFilePath, FOModFormat p_mftModFormat, IEnumerable p_enmStopFolders, string p_strPluginsDirectoryName, IEnumerable p_enmPluginExtensions, IModCacheManager p_mcmModCacheManager, IScriptTypeRegistry p_stgScriptTypeRegistry, bool p_booUsePlugins ) : System

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

GetFile ( string p_strFile ) : byte[]

Retrieves the specified file from the fomod.

GetFileList ( ) : List

Retrieves the list of files in this FOMod.

GetFileList ( string p_strFolderPath, bool p_booRecurse ) : List

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

IsMatchingVersion ( ) : bool

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

ToString ( ) : string

Uses the mod name to represent the mod.

UpdateInfo ( IModInfo p_mifInfo, bool p_booOverwriteAllValues ) : void

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

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

Метод Описание
CreateOrReplaceFile ( string p_strPath, byte p_bteData ) : void

Replaces the specified file with the given data.

DeleteFile ( string p_strPath ) : void

Deletes the specified file.

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().

LoadInfo ( ) : void

Loads the mod metadata from the info file.

LoadInfo ( XmlNode p_xndInfo, bool p_booFillOnlyEmptyValues ) : void

Deserializes an IModInfo from the given XML fragment.

ReplaceFile ( string p_strPath, byte p_bteData ) : void

Replaces the specified file with the given data.

ReplaceFile ( string p_strPath, string p_strData ) : void

Replaces the specified file with the given text.

SaveInfo ( XmlDocument p_xmlDocument ) : XmlNode

Serializes this IModInfo to an XML fragment.

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

Метод Описание
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.

InitializeMovedArchive ( string p_strPathPrefix ) : string

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

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

Starts a read-only transaction.
This puts the FOMod 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

CompareOrderFoldersFirst() публичный статический Метод

public static CompareOrderFoldersFirst ( string x, string y ) : int
x string
y string
Результат int

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

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

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

Replaces the specified file with the given data.
protected CreateOrReplaceFile ( 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

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

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

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

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

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

A simple constructor that initializes the FOMod from the specified file.
public FOMod ( string p_strFilePath, FOModFormat p_mftModFormat, IEnumerable p_enmStopFolders, string p_strPluginsDirectoryName, IEnumerable p_enmPluginExtensions, IModCacheManager p_mcmModCacheManager, IScriptTypeRegistry p_stgScriptTypeRegistry, bool p_booUsePlugins ) : System
p_strFilePath string The mod file from which to create the FOMod.
p_mftModFormat FOModFormat The format of the mod.
p_enmStopFolders IEnumerable
p_strPluginsDirectoryName string The name of the folder that contains plugins.
p_enmPluginExtensions IEnumerable
p_mcmModCacheManager IModCacheManager The manager for the current game mode's mod cache.
p_stgScriptTypeRegistry IScriptTypeRegistry The registry of supported script types.
p_booUsePlugins bool
Результат System

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 fomod.
Thrown if the specified file /// is not in the fomod.
public GetFile ( string p_strFile ) : byte[]
p_strFile string The file to retrieve.
Результат byte[]

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

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

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

Retrieves the list of all files in the specified FOMod folder.
public GetFileList ( string p_strFolderPath, bool p_booRecurse ) : List
p_strFolderPath string The FOMod 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

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

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

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

Loads the mod metadata from the info file.
protected LoadInfo ( ) : void
Результат void

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

Deserializes an IModInfo from the given XML fragment.
protected LoadInfo ( XmlNode p_xndInfo, bool p_booFillOnlyEmptyValues ) : void
p_xndInfo System.Xml.XmlNode The XML fragment from which to deserialize the .
p_booFillOnlyEmptyValues bool Whether to only overwrite null or empty values.
Результат void

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

Replaces the specified file with the given data.
protected ReplaceFile ( 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

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

Replaces the specified file with the given text.
protected ReplaceFile ( 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 an XML fragment.
protected SaveInfo ( XmlDocument p_xmlDocument ) : XmlNode
p_xmlDocument System.Xml.XmlDocument The to use to create the XML elements /// created during the unparsing.
Результат System.Xml.XmlNode

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

Uses the mod name to represent the 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

Описание свойств

IgnoreFolders защищенное свойство

protected List IgnoreFolders
Результат List