I have a MapControl in my app. Some user's have tried to use maps with bad geometry, which seems to load, but as soon as they try to move or zoom the map, the app crashes, and the exception is thrown from Application.Run() because the exception was generated in an event handler thread. I would like to hook up to this exception without having to do top level exception handling, or inherit from the control and override the mousehandlers. Is there any way I can get the exception without the app crashing?
For reference, here's the monster stacktrace (obfuscation and all!):
"The input double value is out of range. Parameter name: maxX"
" at ThinkGeo.MapSuite.Core.x6d719af406ea4c2c.x12e7df23649722cf(Double x86d4512e4c7d8814, String x34decc57f0820440, Double xaee3bf422e2fd725, x1acec04cd58c1af5 xa798986acdb65a29, Double xe21f77686f8b957e, x1acec04cd58c1af5 x495f4164830ffad5)\r\n at ThinkGeo.MapSuite.Core.RectangleShape..ctor(Double minX, Double maxY, Double maxX, Double minY)\r\n at ThinkGeo.MapSuite.Core.x01af2673a54dd1c0.xcbdf7411829a0577(Byte[] x1a22eb38b50994c5)\r\n at ThinkGeo.MapSuite.Core.x01af2673a54dd1c0.GetBoundingBoxFromWkb(Byte[] wkb)\r\n at ThinkGeo.MapSuite.Core.Feature.GetBoundingBox()\r\n at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesInsideBoundingBoxCore(RectangleShape boundingBox, IEnumerable`1 returningColumnNames)\r\n at ThinkGeo.MapSuite.Core.ShapeFileFeatureSource.GetFeaturesInsideBoundingBoxCore(RectangleShape boundingBox, IEnumerable`1 returningColumnNames)\r\n at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesForDrawingCore(RectangleShape boundingBox, Double screenWidth, Double screenHeight, IEnumerable`1 returningColumnNames)\r\n at ThinkGeo.MapSuite.Core.ShapeFileFeatureSource.GetFeaturesForDrawingCore(RectangleShape boundingBox, Double screenWidth, Double screenHeight, IEnumerable`1 returningColumnNames)\r\n at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesForDrawing(RectangleShape boundingBox, Double screenWidth, Double screenHeight, IEnumerable`1 returningColumnNames)\r\n at ThinkGeo.MapSuite.Core.FeatureLayer.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers)\r\n at ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection`1 labelsInAllLayers)\r\n at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas canvas)\r\n at ThinkGeo.MapSuite.DesktopEdition.Overlay.MainDraw(GeoCanvas canvas)\r\n at ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas)\r\n at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x03e3d48bcfe7bb6c(IEnumerable`1 xa6f0db4f183189f1)\r\n at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xff5b27c00f9678c2(RectangleShape x178b193eec228e6e)\r\n at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x742ba885258f6c2c(RectangleShape xb35a33b423b17f65, Overlay x99251f66cdabc2ad, Int32 xa209325f5c895f7e, Int32 x7454a0d1965919b1, GeographyUnit xbb704b4400ce6f76)\r\n at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x88c2a2d6d754e692(IEnumerable`1 xa6f0db4f183189f1)\r\n at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xe3cee4adb9c72451()\r\n at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x9ac8c50f434f4b39(Int32 xb565f4681f05557a)\r\n at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x4eb49068e137ed8f(InteractionArguments x195facd4ef5d753d)\r\n at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xfeca3317d3c75bbb(Object xd9272088e65bd176, x6a8380ab1a7ebb4c xc2fd4c0ed406cdb7)\r\n at ThinkGeo.MapSuite.DesktopEdition.x5cd462d41be2f68a.OnMouseEvent(x6a8380ab1a7ebb4c e)\r\n at ThinkGeo.MapSuite.DesktopEdition.x5cd462d41be2f68a.AnalyseMouseUp(Double screenX, Double screenY, Double worldX, Double worldY, MapMouseButton mouseButton)\r\n at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xd1e58e0ca2447b93(Object xd9272088e65bd176, MouseEventArgs xc2fd4c0ed406cdb7)\r\n at System.Windows.Forms.MouseEventHandler.Invoke(Object sender, MouseEventArgs e)\r\n at System.Windows.Forms.Control.OnMouseUp(MouseEventArgs e)\r\n at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)\r\n at System.Windows.Forms.Control.WndProc(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.Run(Form mainForm)\r\n at BSASoftware.ComplaintTracking.Program.Main(String[] args) in C:\\SourceCode\\DotNet\\Applications\\ComplaintTracking\\Program.cs:line 37\r\n at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)\r\n at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.ThreadHelper.ThreadStart()"