add ToString(fieldCount) & ToShortString()
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
namespace Pilz;
|
namespace Pilz;
|
||||||
|
|
||||||
@@ -27,10 +29,39 @@ public class AppVersion(Version version, int build, AppChannel channel) : ICompa
|
|||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
if (Channel == AppChannel.Stable && Build == 1)
|
string version = Version.ToString();
|
||||||
return Version.ToString();
|
|
||||||
|
|
||||||
return $"{Version} {Channel} {Build}";
|
if (Channel != AppChannel.Stable || Build != 1)
|
||||||
|
version = $"{version} {Channel} {Build}";
|
||||||
|
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual string ToString(int fieldCount)
|
||||||
|
{
|
||||||
|
string version = Version.ToString(fieldCount);
|
||||||
|
|
||||||
|
if (Channel != AppChannel.Stable || Build != 1)
|
||||||
|
version = $"{version} {Channel} {Build}";
|
||||||
|
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual string ToShortString()
|
||||||
|
{
|
||||||
|
string version;
|
||||||
|
|
||||||
|
if (Version.Revision != 0)
|
||||||
|
version = $"{Version.Major}.{Version.Minor}.{Version.Build}.{Version.Revision}";
|
||||||
|
else if (Version.Build != 0)
|
||||||
|
version = $"{Version.Major}.{Version.Minor}.{Version.Build}";
|
||||||
|
else
|
||||||
|
version = $"{Version.Major}.{Version.Minor}";
|
||||||
|
|
||||||
|
if (Channel != AppChannel.Stable || Build != 1)
|
||||||
|
version = $"{version} {Channel} {Build}";
|
||||||
|
|
||||||
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>annotations</Nullable>
|
<Nullable>annotations</Nullable>
|
||||||
<Version>2.3.5</Version>
|
<Version>2.3.6</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user