mirror of
https://github.com/abdelkader/vCardEditor
synced 2025-12-12 08:27:19 +07:00
refactor
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
0.5.4
|
0.5.4
|
||||||
Fix a regression when saving Phones, Website, Email
|
Fix a regression when saving Phones, Website, Email
|
||||||
|
added the update button in the about dialog to check the latest version.
|
||||||
|
|
||||||
0.5.3
|
0.5.3
|
||||||
Support of QR Code.
|
Support of QR Code.
|
||||||
|
|
||||||
|
|||||||
@@ -107,32 +107,24 @@ namespace vCardEditor.View
|
|||||||
|
|
||||||
private async void updateButton_Click(object sender, EventArgs e)
|
private async void updateButton_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string url = ConfigRepository.Instance.VersionUrl;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var client = new System.Net.WebClient())
|
using (var client = new WebClient())
|
||||||
{
|
{
|
||||||
string result = await client.DownloadStringTaskAsync(url);
|
string result = await client.DownloadStringTaskAsync(ConfigRepository.Instance.VersionUrl);
|
||||||
if (result.Length > 0)
|
using (var reader = new StringReader(result))
|
||||||
{
|
{
|
||||||
using (var reader = new StringReader(result))
|
string InternetVersion = reader.ReadLine();
|
||||||
{
|
string AssemblyVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||||
string InternetVersion = reader.ReadLine();
|
Version v1 = new Version(InternetVersion);
|
||||||
string AssemblyVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
Version v2 = new Version(AssemblyVersion);
|
||||||
Version v1 = new Version(InternetVersion);
|
|
||||||
Version v2 = new Version(AssemblyVersion);
|
|
||||||
|
|
||||||
if (v1.CompareTo(v2) > 0)
|
|
||||||
MessageBox.Show(String.Format("New version {0} found!", result));
|
|
||||||
else
|
|
||||||
MessageBox.Show("You have the latest version!");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (v1.CompareTo(v2) > 0)
|
||||||
|
MessageBox.Show(string.Format("New version {0} found!", result), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
else
|
||||||
|
MessageBox.Show("You have the latest version!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (WebException )
|
catch (WebException )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user