diff --git a/FromAssembly.md b/FromAssembly.md index 471f7e8..5940d52 100644 --- a/FromAssembly.md +++ b/FromAssembly.md @@ -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); +} +```