Skip to content

Commit

Permalink
Use where T : IDesignAutomation
Browse files Browse the repository at this point in the history
  • Loading branch information
ricaun committed Aug 28, 2024
1 parent 8b5d778 commit ff2b34e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Add `DesignAutomation` and `IDesignAutomation` interface.
- Add `DesignAutomationLoadVersion` to load the right version of the addin.
- Add `AssemblyResolve` in the `DesignAutomationLoadVersion` to load dependencies in the right version.
- Use `where T : IDesignAutomation` in `DesignAutomation<T>` and `DesignAutomationLoadVersion<T>`.

## [1.3.1] / 2025-06-15 - 2025-08-27
- Add `AddInId` in the output. #9
Expand Down
Binary file modified DesignAutomationConsole/Bundle/RevitAddin.DA.Tester.bundle.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion RevitAddin.DA.Tester/Revit/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public ExternalDBApplicationResult OnStartup(ControlledApplication application)
Console.WriteLine($"AddInName: \t{application.ActiveAddInId?.GetAddInName()}");
Console.WriteLine("----------------------------------------");

designAutomation = new DesignAutomationLoadVersion(typeof(DesignAutomationController));
designAutomation = new DesignAutomationLoadVersion<DesignAutomationController>();
return ExternalDBApplicationResult.Succeeded;
}

Expand Down
2 changes: 1 addition & 1 deletion RevitAddin.DA.Tester/Revit/DesignAutomation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace RevitAddin.DA.Tester.Revit
{
public class DesignAutomation<T> : DesignAutomation
public class DesignAutomation<T> : DesignAutomation where T : IDesignAutomation
{
public DesignAutomation() : base(Activator.CreateInstance(typeof(T)))
{
Expand Down
8 changes: 8 additions & 0 deletions RevitAddin.DA.Tester/Revit/DesignAutomationLoadVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@

namespace RevitAddin.DA.Tester.Revit
{
public class DesignAutomationLoadVersion<T> : DesignAutomationLoadVersion where T : IDesignAutomation
{
public DesignAutomationLoadVersion() : base(typeof(T))
{

}
}

public class DesignAutomationLoadVersion : IDisposable
{
readonly IDisposable designAutomation;
Expand Down
2 changes: 1 addition & 1 deletion RevitAddin.DA.Tester/RevitAddin.DA.Tester.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

<PropertyGroup>
<PackageId>RevitAddin.DA.Tester</PackageId>
<Version>1.4.0-alpha</Version>
<Version>1.4.0-beta</Version>
<ProjectGuid>{7C324916-9F8D-43B0-B226-DA67D2504393}</ProjectGuid>
</PropertyGroup>

Expand Down

0 comments on commit ff2b34e

Please sign in to comment.