初步重构 Contollers

This commit is contained in:
ChsBuffer
2020-07-09 05:00:56 +08:00
parent f605bfa437
commit 3c0a0d5f80
20 changed files with 592 additions and 1101 deletions

View File

@@ -17,6 +17,10 @@ namespace Netch.Controllers
public const string Owner = @"NetchX";
public const string Repo = @"Netch";
public const string Name = @"Netch";
public const string Copyright = @"Copyright © 2019 - 2020";
public const string Version = @"1.4.11";
public string LatestVersionNumber;
public string LatestVersionUrl;
@@ -24,10 +28,6 @@ namespace Netch.Controllers
public event EventHandler NewVersionFoundFailed;
public event EventHandler NewVersionNotFound;
public const string Name = @"Netch";
public const string Copyright = @"Copyright © 2019 - 2020";
public const string Version = @"1.4.11";
public async void Check(bool notifyNoFound, bool isPreRelease)
{
try
@@ -48,19 +48,13 @@ namespace Netch.Controllers
else
{
LatestVersionNumber = latestRelease.tag_name;
if (notifyNoFound)
{
NewVersionNotFound?.Invoke(this, new EventArgs());
}
if (notifyNoFound) NewVersionNotFound?.Invoke(this, new EventArgs());
}
}
catch (Exception e)
{
Debug.WriteLine(e.Message);
if (notifyNoFound)
{
NewVersionFoundFailed?.Invoke(this, new EventArgs());
}
if (notifyNoFound) NewVersionFoundFailed?.Invoke(this, new EventArgs());
}
}
@@ -84,4 +78,4 @@ namespace Netch.Controllers
return resultStr;
}
}
}
}