C# Класс Terrarium.Game.PrivateAssemblyCache

Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
Initialize void
PrivateAssemblyCache System
ResolveAssembly System.Reflection.Assembly
checkAssemblyWithReporting int
getAssemblyWithTerrariumBindingPolicy System.Reflection.Assembly

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

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

Blacklist a series of assemblies by setting their assemblies to zero length files. This is a way of ensuring that we don't load them again, or replace them with fresh working copies because the file name gets reserved with an invalid assembly.

Close ( ) : void

Handles controlled shut-down of the PAC and unhooking the assembly resolving events.

Exists ( string fullName ) : System.Boolean

Determine if the assembly with the given full name exists within the PAC.

GetAssemblies ( ) : Terrarium.Game.OrganismAssemblyInfo[]

Gets a full listing of all of the assemblies in the cache. This can be used to populate dropdowns or lists.

GetAssemblyShortName ( string fullName ) : string

Given an assembly full name, generates an assembly short name.

GetAssemblyVersion ( string fullName ) : string

Given an assembly full name, generates an assembly version string.

GetBaseAssemblyDirectory ( string dataPath, string dataFile ) : string

Creates a base assembly directory without obfuscation from a path and file name.

GetBlacklistedAssemblies ( ) : string[]

Get a list of all assemblies in the cache that have 0 bytes. A 0 byte assembly fails to load.

GetFileName ( string fullName ) : string

Given an assembly full name, generates a library file name for an assembly.

GetSafeTempFileName ( ) : string

Creates a temp file that can't be guessed for security reasons.

HookAssemblyResolve ( ) : void

Hooks the assembly resolving events for the current app domain.

LoadOrganismAssembly ( string fullName ) : Assembly

Load an organism assembly. Calculate the size of the PAC based on the assemblies loaded.

PrivateAssemblyCache ( string dataPath, string dataFile ) : System

Creates a new private assembly cache initialized with a data path and data file.

PrivateAssemblyCache ( string dataPath, string dataFile, bool hookAssemblyResolve, bool trackLastRun ) : System

Creates a new private assembly cache initialized with a data path, data file, and controls whether assemblies are resolved, and organism tracking is in effect.

SaveOrganismAssembly ( string assemblyPath, string fullName ) : void

Save an assembly given a full path to the assembly and the full name of the assembly to the cache.

SaveOrganismAssembly ( string assemblyPath, string symbolPath, string fullName ) : void

Save an assembly along with symbols given a full path to the assembly and symbols to the cache.

SaveOrganismBytes ( byte bytes, string fullName ) : void

Saves the array of bytes given an assembly full name to the private assembly cache.

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

Метод Описание
OnPacAssembliesChanged ( EventArgs e ) : void

Helper function for calling the PacAssembliesChanged event.

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

Метод Описание
Initialize ( string dataPath, string dataFile, bool hookAssemblyResolve, bool trackLastRun ) : void

Helper function for initializing the PAC constructors.

PrivateAssemblyCache ( ) : System

Initializes a versioned directory preamble used to create versioned assembly directories.

ResolveAssembly ( Object sender, ResolveEventArgs args ) : Assembly

Called whenever assemblies are being resolved for use.

checkAssemblyWithReporting ( string assemblyName, string xmlFile ) : int

Used for assembly validation with XML reporting in AsmCheck

getAssemblyWithTerrariumBindingPolicy ( string testAssemblyName, Assembly potentialMatchAssembly ) : Assembly

Check to see if an assembly can be found that matches a reduced set of fusion version requirements. We ignore the revision.

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

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

Blacklist a series of assemblies by setting their assemblies to zero length files. This is a way of ensuring that we don't load them again, or replace them with fresh working copies because the file name gets reserved with an invalid assembly.
public BlacklistAssemblies ( string assemblies ) : void
assemblies string The assemblies to be blacklisted.
Результат void

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

Handles controlled shut-down of the PAC and unhooking the assembly resolving events.
public Close ( ) : void
Результат void

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

Determine if the assembly with the given full name exists within the PAC.
public Exists ( string fullName ) : System.Boolean
fullName string The full name of the assembly to check for.
Результат System.Boolean

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

Gets a full listing of all of the assemblies in the cache. This can be used to populate dropdowns or lists.
public GetAssemblies ( ) : Terrarium.Game.OrganismAssemblyInfo[]
Результат Terrarium.Game.OrganismAssemblyInfo[]

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

Given an assembly full name, generates an assembly short name.
public static GetAssemblyShortName ( string fullName ) : string
fullName string The assembly full name.
Результат string

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

Given an assembly full name, generates an assembly version string.
public static GetAssemblyVersion ( string fullName ) : string
fullName string The assembly full name.
Результат string

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

Creates a base assembly directory without obfuscation from a path and file name.
public static GetBaseAssemblyDirectory ( string dataPath, string dataFile ) : string
dataPath string The base path of the data file.
dataFile string The name of the datafile for creating a cache directory.
Результат string

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

Get a list of all assemblies in the cache that have 0 bytes. A 0 byte assembly fails to load.
public GetBlacklistedAssemblies ( ) : string[]
Результат string[]

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

Given an assembly full name, generates a library file name for an assembly.
public GetFileName ( string fullName ) : string
fullName string The assembly full name.
Результат string

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

Creates a temp file that can't be guessed for security reasons.
public static GetSafeTempFileName ( ) : string
Результат string

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

Hooks the assembly resolving events for the current app domain.
public HookAssemblyResolve ( ) : void
Результат void

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

Load an organism assembly. Calculate the size of the PAC based on the assemblies loaded.
public LoadOrganismAssembly ( string fullName ) : Assembly
fullName string The name of the assembly to load.
Результат System.Reflection.Assembly

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

Helper function for calling the PacAssembliesChanged event.
protected OnPacAssembliesChanged ( EventArgs e ) : void
e System.EventArgs Null
Результат void

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

Creates a new private assembly cache initialized with a data path and data file.
public PrivateAssemblyCache ( string dataPath, string dataFile ) : System
dataPath string Path where the data will be stored.
dataFile string Path to a tracking data file.
Результат System

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

Creates a new private assembly cache initialized with a data path, data file, and controls whether assemblies are resolved, and organism tracking is in effect.
public PrivateAssemblyCache ( string dataPath, string dataFile, bool hookAssemblyResolve, bool trackLastRun ) : System
dataPath string Path to where the cache will be stored.
dataFile string Path to the tracking data file.
hookAssemblyResolve bool Determines if the assembly resolving events are hooked.
trackLastRun bool Determines if organism tracking is senabled.
Результат System

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

Save an assembly given a full path to the assembly and the full name of the assembly to the cache.
public SaveOrganismAssembly ( string assemblyPath, string fullName ) : void
assemblyPath string A local path to the assembly.
fullName string The full name of the assembly.
Результат void

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

Save an assembly along with symbols given a full path to the assembly and symbols to the cache.
public SaveOrganismAssembly ( string assemblyPath, string symbolPath, string fullName ) : void
assemblyPath string A local path to the assembly.
symbolPath string A local path to the symbols.
fullName string The full name of the assembly.
Результат void

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

Saves the array of bytes given an assembly full name to the private assembly cache.
public SaveOrganismBytes ( byte bytes, string fullName ) : void
bytes byte The bytes of the assembly.
fullName string The full name of the original assembly.
Результат void