File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 10
10
using System . Diagnostics ;
11
11
using System . IO ;
12
12
using System . Linq ;
13
+ using System . Net . Http ;
13
14
using System . Reflection ;
14
15
using System . Text ;
15
16
using System . Text . RegularExpressions ;
@@ -307,6 +308,29 @@ private void Init()
307
308
308
309
// Set Treeview Matches Result base contextMenu
309
310
MatchResultsTreeView . ContextMenu = MatchResultsTreeView . Resources [ "cmMatchResultsMenu" ] as ContextMenu ;
311
+
312
+ CheckUpdates ( ) ;
313
+ }
314
+
315
+ private async void CheckUpdates ( )
316
+ {
317
+ double hoursFromLastCheck = Math . Abs ( ( DateTime . Now - Config . Instance . LastUpdateCheck ) . TotalHours ) ;
318
+
319
+ //if (hoursFromLastCheck > 8)
320
+ if ( true )
321
+ {
322
+ try
323
+ {
324
+ HttpClient client = new HttpClient ( ) ;
325
+
326
+ var response = await client . GetAsync ( "https://github.com/codingseb/CSharpRegexTools4Npp/releases" ) ;
327
+
328
+ string responseText = await response . Content . ReadAsStringAsync ( ) ;
329
+
330
+
331
+ }
332
+ catch { }
333
+ }
310
334
}
311
335
312
336
private void BuildRegexOptionsCheckBoxs ( )
Original file line number Diff line number Diff line change @@ -130,5 +130,7 @@ private void Init()
130
130
public bool ShowEndOfLinesCSharpTextSourceEditorOption { get ; set ; }
131
131
132
132
public bool ShowCSharpTextSourceTestInANewTab { get ; set ; } = true ;
133
+
134
+ public DateTime LastUpdateCheck { get ; set ; } = DateTime . Now . AddHours ( - 8 ) ;
133
135
}
134
136
}
You can’t perform that action at this time.
0 commit comments