Detailed Description

Scans all the types in an assembly, checking if they're any of the types we're after.

Public Member Functions

 AssemblyScanner ()
 
void MergeInto (AssemblyScanner scanner)
 Merges the scanners from this into the given one. More...
 
void ScanAll ()
 Scans all loaded assemblies. More...
 
void FindAllSubTypes (Type type, OnFoundTypeEvent found)
 Checks for the given type. More...
 
void FindAllSubTypes (int pass, Type type, OnFoundTypeEvent found)
 Checks for the given type. Optionally allow multiple passes (e.g. if searching for a type requires other types to be ready to go). More...
 
void FindAllSubTypes (int pass, Type type, OnFoundTypeEvent found, bool allowGeneric)
 Checks for the given type. Optionally allow multiple passes (e.g. if searching for a type requires other types to be ready to go). More...
 
void Scan (Type type)
 Scans the assembly containing the given type now. More...
 
void Scan (Assembly asm)
 Scans the given assembly now. More...
 

Static Public Member Functions

static void FindAllSubTypesNow (Type type, OnFoundTypeEvent mtd)
 Finds all subtypes and registers the handler for any newly loaded assemblies. More...
 
static void ScanThisNow (AssemblyScannerMethod mtd)
 Scans the assembly containing the given method which adds the types to look for. More...
 
static void ScanAllNow (AssemblyScannerMethod mtd)
 Scans all loaded assemblies. The given method provides the types to look for. Stores the scanner globally so any newly loaded assemblies will get scanned too. More...
 
static void ScanAllNow (AssemblyScannerMethod mtd, bool sharedScanner)
 Scans all loaded assemblies. The given method provides the types to look for. More...
 

Private Member Functions

void Add (int pass, TypeToFind ttf)
 Adds a type to find to the given pass. More...
 
void ScanPass (Assembly asm, List< TypeToFind > set)
 Performs one of the scan passes. More...
 

Private Attributes

SortedDictionary< int, List
< TypeToFind > > 
ToFind
 All the types to look out for, sorted by pass number. More...
 

Constructor & Destructor Documentation

Modular.AssemblyScanner.AssemblyScanner ( )
inline

Member Function Documentation

void Modular.AssemblyScanner.Add ( int  pass,
TypeToFind  ttf 
)
inlineprivate

Adds a type to find to the given pass.

void Modular.AssemblyScanner.FindAllSubTypes ( Type  type,
OnFoundTypeEvent  found 
)
inline

Checks for the given type.

void Modular.AssemblyScanner.FindAllSubTypes ( int  pass,
Type  type,
OnFoundTypeEvent  found 
)
inline

Checks for the given type. Optionally allow multiple passes (e.g. if searching for a type requires other types to be ready to go).

void Modular.AssemblyScanner.FindAllSubTypes ( int  pass,
Type  type,
OnFoundTypeEvent  found,
bool  allowGeneric 
)
inline

Checks for the given type. Optionally allow multiple passes (e.g. if searching for a type requires other types to be ready to go).

static void Modular.AssemblyScanner.FindAllSubTypesNow ( Type  type,
OnFoundTypeEvent  mtd 
)
inlinestatic

Finds all subtypes and registers the handler for any newly loaded assemblies.

void Modular.AssemblyScanner.MergeInto ( AssemblyScanner  scanner)
inline

Merges the scanners from this into the given one.

void Modular.AssemblyScanner.Scan ( Type  type)
inline

Scans the assembly containing the given type now.

void Modular.AssemblyScanner.Scan ( Assembly  asm)
inline

Scans the given assembly now.

void Modular.AssemblyScanner.ScanAll ( )
inline

Scans all loaded assemblies.

static void Modular.AssemblyScanner.ScanAllNow ( AssemblyScannerMethod  mtd)
inlinestatic

Scans all loaded assemblies. The given method provides the types to look for. Stores the scanner globally so any newly loaded assemblies will get scanned too.

static void Modular.AssemblyScanner.ScanAllNow ( AssemblyScannerMethod  mtd,
bool  sharedScanner 
)
inlinestatic

Scans all loaded assemblies. The given method provides the types to look for.

Parameters
sharedScannerTrue if you'd like the scanners to be stored globally. They'll then be used on any newly loaded assemblies.
void Modular.AssemblyScanner.ScanPass ( Assembly  asm,
List< TypeToFind set 
)
inlineprivate

Performs one of the scan passes.

static void Modular.AssemblyScanner.ScanThisNow ( AssemblyScannerMethod  mtd)
inlinestatic

Scans the assembly containing the given method which adds the types to look for.

Member Data Documentation

SortedDictionary<int,List<TypeToFind> > Modular.AssemblyScanner.ToFind
private

All the types to look out for, sorted by pass number.