start a big rework
This commit is contained in:
@@ -3,16 +3,16 @@ using System;
|
||||
|
||||
namespace Pilz.Updating;
|
||||
|
||||
public class ApplicationVersion
|
||||
public class ApplicationVersion(Version version, int build, Channels channel)
|
||||
{
|
||||
|
||||
// P r o p e r t i e s
|
||||
|
||||
[JsonConverter(typeof(Newtonsoft.Json.Converters.VersionConverter))]
|
||||
public Version Version { get; set; }
|
||||
public int Build { get; set; }
|
||||
public Version Version { get; set; } = version;
|
||||
public int Build { get; set; } = build;
|
||||
[JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
|
||||
public Channels Channel { get; set; }
|
||||
public Channels Channel { get; set; } = channel;
|
||||
|
||||
// C o n s t r u c t o r s
|
||||
|
||||
@@ -24,13 +24,6 @@ public class ApplicationVersion
|
||||
{
|
||||
}
|
||||
|
||||
public ApplicationVersion(Version version, int build, Channels channel)
|
||||
{
|
||||
Version = version;
|
||||
Build = build;
|
||||
Channel = channel;
|
||||
}
|
||||
|
||||
// F e a t u r e s
|
||||
|
||||
public override string ToString()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using global::System.IO;
|
||||
using System;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Pilz.Updating;
|
||||
|
||||
@@ -13,11 +13,8 @@ internal static class MyPaths
|
||||
{
|
||||
p = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "PilzUpdater");
|
||||
if (!Directory.Exists(p))
|
||||
{
|
||||
Directory.CreateDirectory(p);
|
||||
}
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using global::Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Pilz.Updating;
|
||||
@@ -10,11 +10,11 @@ public class UpdateInfo
|
||||
|
||||
public static UpdateInfo Parse(string str)
|
||||
{
|
||||
return JObject.Parse(str).ToObject<UpdateInfo>();
|
||||
return JsonConvert.DeserializeObject<UpdateInfo>(str);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JObject.FromObject(this).ToString();
|
||||
return JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,9 @@
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Pilz.Updating;
|
||||
namespace Pilz.Updating;
|
||||
|
||||
public class UpdatePackageInfo
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public ApplicationVersion Version { get; set; }
|
||||
public UpdateNotes Notes { get; } = new UpdateNotes();
|
||||
public UpdateNotes Notes { get; } = new();
|
||||
public string Packagelink { get; set; }
|
||||
|
||||
[JsonProperty]
|
||||
private string Changelog
|
||||
{
|
||||
set
|
||||
{
|
||||
Notes.Content = value;
|
||||
Notes.ContentType = UpdateNotesContentType.PlainText;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user