44using MetroFramework . Forms ;
55using System ;
66using System . Collections . Generic ;
7+ using System . Diagnostics ;
78using System . Windows . Forms ;
89
910namespace 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}
0 commit comments