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 1010using System . Diagnostics ;
1111using System . IO ;
1212using System . Linq ;
13+ using System . Net . Http ;
1314using System . Reflection ;
1415using System . Text ;
1516using System . Text . RegularExpressions ;
@@ -307,6 +308,29 @@ private void Init()
307308
308309 // Set Treeview Matches Result base contextMenu
309310 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+ }
310334 }
311335
312336 private void BuildRegexOptionsCheckBoxs ( )
Original file line number Diff line number Diff line change @@ -130,5 +130,7 @@ private void Init()
130130 public bool ShowEndOfLinesCSharpTextSourceEditorOption { get ; set ; }
131131
132132 public bool ShowCSharpTextSourceTestInANewTab { get ; set ; } = true ;
133+
134+ public DateTime LastUpdateCheck { get ; set ; } = DateTime . Now . AddHours ( - 8 ) ;
133135 }
134136}
You can’t perform that action at this time.
0 commit comments