-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
3 additions
and
59 deletions.
There are no files selected for viewing
21 changes: 1 addition & 20 deletions
21
build/MicaSetup.Tools/MakeIcon/ViewModels/AboutViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,10 @@ | ||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using System; | ||
using System.Reflection; | ||
using System.Text; | ||
|
||
namespace MakeIcon.ViewModels; | ||
|
||
public partial class AboutViewModel : ObservableObject | ||
{ | ||
[ObservableProperty] | ||
private string version = $"v{Assembly.GetCallingAssembly().GetAssemblyVersion()}"; | ||
} | ||
|
||
file static class AssemblyExtensions | ||
{ | ||
public static string GetAssemblyVersion(this Assembly assembly) | ||
{ | ||
Version version = assembly.GetName().Version; | ||
StringBuilder sb = new(); | ||
|
||
sb.Append(version.Major); | ||
sb.Append("."); | ||
sb.Append(version.Minor); | ||
sb.Append("."); | ||
sb.Append(version.Build); | ||
|
||
return sb.ToString(); | ||
} | ||
private string version = $"v{Assembly.GetCallingAssembly().GetName().Version.ToString(3)}"; | ||
} |
21 changes: 1 addition & 20 deletions
21
build/MicaSetup.Tools/MakeMica/ViewModels/AboutViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,10 @@ | ||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using System; | ||
using System.Reflection; | ||
using System.Text; | ||
|
||
namespace MakeMica.ViewModels; | ||
|
||
public partial class AboutViewModel : ObservableObject | ||
{ | ||
[ObservableProperty] | ||
private string version = $"v{Assembly.GetCallingAssembly().GetAssemblyVersion()}"; | ||
} | ||
|
||
file static class AssemblyExtensions | ||
{ | ||
public static string GetAssemblyVersion(this Assembly assembly) | ||
{ | ||
Version version = assembly.GetName().Version; | ||
StringBuilder sb = new(); | ||
|
||
sb.Append(version.Major); | ||
sb.Append("."); | ||
sb.Append(version.Minor); | ||
sb.Append("."); | ||
sb.Append(version.Build); | ||
|
||
return sb.ToString(); | ||
} | ||
private string version = $"v{Assembly.GetCallingAssembly().GetName().Version.ToString(3)}"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,10 @@ | ||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using System.Reflection; | ||
using System.Text; | ||
|
||
namespace MakeMui.ViewModels; | ||
|
||
public partial class AboutViewModel : ObservableObject | ||
{ | ||
[ObservableProperty] | ||
private string version = $"v{Assembly.GetCallingAssembly().GetAssemblyVersion()}"; | ||
} | ||
|
||
file static class AssemblyExtensions | ||
{ | ||
public static string GetAssemblyVersion(this Assembly assembly) | ||
{ | ||
Version version = assembly.GetName().Version; | ||
StringBuilder sb = new(); | ||
|
||
sb.Append(version.Major); | ||
sb.Append("."); | ||
sb.Append(version.Minor); | ||
sb.Append("."); | ||
sb.Append(version.Build); | ||
|
||
return sb.ToString(); | ||
} | ||
private string version = $"v{Assembly.GetCallingAssembly().GetName().Version.ToString(3)}"; | ||
} |