Skip to content

Commit

Permalink
Fix AppUtils to show ProductName.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricaun committed Dec 18, 2024
1 parent fe3f61c commit 43e0ba2
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Make project public
### Application
- Remove `net46` framework, remove `Revit 2017` and `Revit 2018` support.
### Command
- Fix `AppUtils` to show `ProductName`.
### Console
- Update `ricaun.Revit.Installation` to `1.3.1`.
- Add `EnvironmentVariable` class, with `ProcessArguments` and `TimeoutNotBusyMaxSeconds` variables.
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<Version>1.8.0-rc.2</Version>
<Version>1.8.0-rc.3</Version>
</PropertyGroup>
</Project>
21 changes: 18 additions & 3 deletions ricaun.RevitTest.Command/Utils/AppUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,31 @@ namespace ricaun.RevitTest.Command.Utils
public static class AppUtils
{
/// <summary>
/// Get Info (Assembly Name, Version and Target Framework)
/// Get Info (Product Name, Version and Target Framework)
/// </summary>
/// <returns></returns>
public static string GetInfo()
{
var assemblyName = typeof(AppUtils).Assembly.GetName();
var info = $"{assemblyName.Name} {GetSemanticVersion()} [{GetTargetFrameworkName()}]";
var info = $"{GetProduct()} {GetSemanticVersion()} [{GetTargetFrameworkName()}]";
return info;
}

/// <summary>
/// Get Product Name
/// </summary>
/// <returns></returns>
public static string GetProduct()
{
var assembly = typeof(AppUtils).Assembly;
string product = assembly.GetName().Name;
try
{
product = assembly.GetCustomAttribute<AssemblyProductAttribute>().Product;
}
catch { }
return product;
}

/// <summary>
/// Get Semantic Version
/// </summary>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 43e0ba2

Please sign in to comment.