Add project files.

This commit is contained in:
2022-04-30 10:46:44 -05:00
parent 3848a11a46
commit b432db6af7
23 changed files with 1444 additions and 0 deletions

21
GpsTestApp/Extensions.cs Normal file
View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace GpsTestApp {
public static class Extensions {
public static void InvokeIfRequired(this Control c, Action a) {
if (c.InvokeRequired) {
c.Invoke(new MethodInvoker(() => { InvokeIfRequired(c, a); }));
return;
}
try {
if (!c.IsHandleCreated) { IntPtr i = c.Handle; } // See links above - handle is not created, will cause cross-thread exceptions
a.Invoke();
} catch (Exception ex) { }
}
}
}