Skip to content

Commit ab07c6a

Browse files
committed
Check for Update
1 parent c264895 commit ab07c6a

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

IMDbAPI_Client/MainForm.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using MetroFramework.Forms;
55
using System;
66
using System.Collections.Generic;
7+
using System.Diagnostics;
78
using System.Windows.Forms;
89

910
namespace IMDbAPI_Client
@@ -13,8 +14,15 @@ public partial class MainForm : MetroForm
1314
public MainForm()
1415
{
1516
InitializeComponent();
17+
18+
var assembly = System.Reflection.Assembly.GetExecutingAssembly();
19+
var fileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
20+
var version = new Version(fileVersionInfo.ProductVersion);
21+
_version = btnVersion.Text = $"v{version.ToString(2)}";
1622
}
1723

24+
25+
private string _version;
1826
private List<GridData> _gridDataItems;
1927

2028
private UserControl _currentUC;
@@ -241,5 +249,26 @@ private void btnPing_Click(object sender, EventArgs e)
241249
{
242250
new PingForm().ShowDialog();
243251
}
252+
253+
private void btnVersion_Click(object sender, EventArgs e)
254+
{
255+
string url = "https://imdb-api.com/client";
256+
var ps = new ProcessStartInfo(url)
257+
{
258+
UseShellExecute = true,
259+
Verb = "open"
260+
};
261+
Process.Start(ps);
262+
}
263+
264+
private void btnVersion_MouseEnter(object sender, EventArgs e)
265+
{
266+
btnVersion.Text = "CHECK FOR UPDATE";
267+
}
268+
269+
private void btnVersion_MouseLeave(object sender, EventArgs e)
270+
{
271+
btnVersion.Text = _version;
272+
}
244273
}
245274
}

IMDbAPI_Client/MainForm.designer.cs

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)