2024-03-26 07:11:06 -07:00
|
|
|
|
using System.Reflection;
|
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
|
|
|
|
namespace SourceGit.Models
|
|
|
|
|
{
|
2024-07-22 23:36:27 -07:00
|
|
|
|
public class Version
|
2024-03-26 07:11:06 -07:00
|
|
|
|
{
|
|
|
|
|
[JsonPropertyName("name")]
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("tag_name")]
|
|
|
|
|
public string TagName { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("body")]
|
|
|
|
|
public string Body { get; set; }
|
|
|
|
|
|
|
|
|
|
public bool IsNewVersion
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2024-07-22 23:36:27 -07:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
System.Version version = new System.Version(TagName.Substring(1));
|
|
|
|
|
System.Version current = Assembly.GetExecutingAssembly().GetName().Version!;
|
|
|
|
|
return current.CompareTo(version) < 0;
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
2024-03-31 01:54:29 -07:00
|
|
|
|
return false;
|
2024-07-22 23:36:27 -07:00
|
|
|
|
}
|
2024-03-26 07:11:06 -07:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class AlreadyUpToDate { }
|
2024-03-31 01:54:29 -07:00
|
|
|
|
}
|