C# 클래스 Nexus.Client.Mods.Formats.OMod.OMod

Encapsulates a OMod mod archive.
상속: ObservableObject, IMod
파일 보기 프로젝트 열기: NexusMods/NexusModManager-4.5

공개 메소드들

메소드 설명
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