Hi guys,
This is not a horrible problem but it appears to be a bug in the ThinkGeo codebase. I have a attached a sample project that demonstrates the problem. Basically, you can delete features from shapefiles with no problem until you try to delete the last one and then an exception is thrown:
System.NullReferenceException was unhandled
Message=Object reference not set to an instance of an object.
Source=MapSuiteCore
StackTrace:
at ThinkGeo.MapSuite.Core.ShapeFileFeatureSource.CommitTransactionCore(TransactionBuffer transactions)
at ThinkGeo.MapSuite.Core.FeatureSource.CommitTransaction()
at ThinkGeo.MapSuite.Core.EditTools.CommitTransaction()
at DeleteTest.Form1.WinformsMap1_KeyUp(Object sender, KeyEventArgs e) in C:\Users\steller\Documents\Visual Studio 2010\Projects\ThinkGeo\Delete Feature From Shapefile Test\Form1.vb:line 68
at System.Windows.Forms.KeyEventHandler.Invoke(Object sender, KeyEventArgs e)
at System.Windows.Forms.Control.OnKeyUp(KeyEventArgs e)
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at DeleteTest.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Thanks!
Steve
Delete_Feature_From_Shapefile_Test.zip (23.2 KB)