parent
6e2adc3ece
commit
1abdd13c91
1 changed files with 29 additions and 1 deletions
@ -1 +1,29 @@ |
|||||||
The `FromAssembly` class is a static helper class that supplies methods to find the wanted `Assembly` for an `IAssemblyInstaller`. Is acts similar to a factory in the way that its methods return a new instance of an `IAssemblyInstaller` with the assembly that they provide. |
The `FromAssembly` class is a static helper class that supplies methods to find the wanted `Assembly` for an `IAssemblyInstaller`. |
||||||
|
It acts similar to a factory in the way that its methods return a new instance of an `IAssemblyInstaller` with the assembly that they provide. |
||||||
|
|
||||||
|
There are two different methods that create `IAssemblyInstaller`s: |
||||||
|
|
||||||
|
## `This()` |
||||||
|
|
||||||
|
The `This()` method creates an `IAssemblyInstaller` that installs from the `Assembly` that calls the method. |
||||||
|
This is done by using the `Assembly.GetCallingAssembly()` method: |
||||||
|
|
||||||
|
```c# |
||||||
|
public static IAssemblyInstaller This() |
||||||
|
{ |
||||||
|
Assembly assembly = Assembly.GetCallingAssembly(); |
||||||
|
return new AssemblyInstaller(assembly); |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
## `Instance()` |
||||||
|
|
||||||
|
The `Instance()` method creates an `IAssemblyInstaller` that installs from the `Assembly` instance that is given to the method. |
||||||
|
This is done by straightforwardly creating an `IAssemblyInstaller`: |
||||||
|
|
||||||
|
```c# |
||||||
|
public static IAssemblyInstaller Instance(Assembly assembly) |
||||||
|
{ |
||||||
|
return new AssemblyInstaller(assembly); |
||||||
|
} |
||||||
|
``` |
||||||
|
|||||||
Loading…
Reference in new issue