You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.2 KiB
46 lines
1.2 KiB
using System; |
|
using System.Collections.Generic; |
|
using System.Linq; |
|
using System.Text; |
|
|
|
namespace ArdupilotMega.Controls |
|
{ |
|
/// <summary> |
|
/// Mono handles calls from other thread difrently - this prevents those crashs |
|
/// </summary> |
|
class myGMAP : GMap.NET.WindowsForms.GMapControl |
|
{ |
|
public bool inOnPaint = false; |
|
string otherthread = ""; |
|
|
|
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) |
|
{ |
|
if (inOnPaint) |
|
{ |
|
Console.WriteLine("Was in onpaint Gmap th:" + System.Threading.Thread.CurrentThread.Name + " in " + otherthread); |
|
return; |
|
} |
|
|
|
otherthread = System.Threading.Thread.CurrentThread.Name; |
|
|
|
inOnPaint = true; |
|
|
|
try |
|
{ |
|
base.OnPaint(e); |
|
} |
|
catch (Exception ex) { Console.WriteLine(ex.ToString()); } |
|
|
|
inOnPaint = false; |
|
} |
|
|
|
protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e) |
|
{ |
|
try |
|
{ |
|
base.OnMouseMove(e); |
|
} |
|
catch (Exception ex) { Console.WriteLine(ex.ToString()); } |
|
} |
|
} |
|
}
|
|
|