Class DependentAssemblies
Use instances of this class to enumerate the dependents of an assembly.
Inheritance
Namespace: WizardWrx.AssemblyUtils
Assembly: WizardWrx.AssemblyUtils.dll
Syntax
public class DependentAssemblies : object
Constructors
| Improve this Doc View SourceDependentAssemblies()
Create an instance that has the calling assembly as its root.
Declaration
public DependentAssemblies()
DependentAssemblies(Assembly)
Create an instance that has a specified assembly as its root.
Declaration
public DependentAssemblies(Assembly pasmTopLevel)
Parameters
Type | Name | Description |
---|---|---|
Assembly | pasmTopLevel | Specify the assembly to establish as the top level reference assembly. |
Properties
| Improve this Doc View SourceNamesOfDependentAssemblies
Return a reference to the DependentAssemblyInfo List.
Declaration
public List<DependentAssemblyInfo> NamesOfDependentAssemblies { get; }
Property Value
Type | Description |
---|---|
List<DependentAssemblyInfo> |
Root
Get the root assembly around which the instance was constructed.
Declaration
public Assembly Root { get; }
Property Value
Type | Description |
---|---|
Assembly |
Methods
| Improve this Doc View SourceAssemblyDependsUpon(AssemblyName)
Return TRUE if the root assembly of the instance depends upon the assembly named in its argument.
Declaration
public bool AssemblyDependsUpon(AssemblyName panMaybeDependent)
Parameters
Type | Name | Description |
---|---|---|
AssemblyName | panMaybeDependent | Specify the AssemblyName property, preferably fully qualified. |
Returns
Type | Description |
---|---|
System.Boolean | If the assembly specified as the root when the instance was created depends upon the assembly named in the argument, the return value is TRUE. Otherwise, the return value is FALSE. |
DependentAssemblyIsLoaded(AssemblyName)
Return TRUE if the root assembly of the instance depends upon the assembly named in its argument AND that assembly is loaded.
Declaration
public bool DependentAssemblyIsLoaded(AssemblyName panMaybeDependent)
Parameters
Type | Name | Description |
---|---|---|
AssemblyName | panMaybeDependent | Specify the AssemblyName property, preferably fully qualified. |
Returns
Type | Description |
---|---|
System.Boolean | If the assembly specified as the root when the instance was created depends upon the assembly named in the argument, and the named assembly is loaded into the default Application Domain, the return value is TRUE. Otherwise, the return value is FALSE. |
DestroyDependents()
This object gets an explicitly implemented destructor, because it may acquire a secondary AppDomain that should be destroyed before the main processing routine progresses further.
Declaration
public void DestroyDependents()
DisplayProperties(StreamWriter, Char)
List the properties of each dependent assembly.
Declaration
public void DisplayProperties(StreamWriter pswOut = null, char pchrDelimiter = null)
Parameters
Type | Name | Description |
---|---|---|
StreamWriter | pswOut | Specify the optional output StreamWriter onto which the dependent assembly details are to be written. The default value is NULL, which suppresses output. |
System.Char | pchrDelimiter | Specify the optional field delimiter. The default value is a comma. |
EnumerateDependents()
Enumerate the dependent assemblies.
Declaration
public void EnumerateDependents()
GetDependentAssemblyByName(AssemblyName, Boolean)
Get a reference to the named dependent assembly.
Declaration
public Assembly GetDependentAssemblyByName(AssemblyName panMaybeDependent, bool pfDynamicLoadingPermitted = false)
Parameters
Type | Name | Description |
---|---|---|
AssemblyName | panMaybeDependent | Specify the AssemblyName property, preferably fully qualified. |
System.Boolean | pfDynamicLoadingPermitted | Set this flag to TRUE to permit an assembly to be loaded to satisfy the request. The default is FALSE, so that a request is unsatisfied unless the required assembly is already loaded. |
Returns
Type | Description |
---|---|
Assembly | If the named assembly is a dependent, and it is successfully loaded, the return value is a reference to the assembly. If the assembly was already loaded into the default application domain, the reference is to that assembly. Otherwise, the reference is to the assembly that was loaded into the private application domain. |
GetDependentAssemblyInfos()
When called on an instance, this method returns a sorted list of the dependent assemblies of the assembly that was passed into its constructor.
Declaration
public List<DependentAssemblyInfo> GetDependentAssemblyInfos()
Returns
Type | Description |
---|---|
List<DependentAssemblyInfo> | If the method succeeds, the return value is a generic list of DependentAssemblyInfo objects, sorted by name. |