HERE IS SUMMARY OF IMPORTANT CHANGES IN VERSION 4.9.3. IT'S RECOMMENDED TO READ THIS BEFORE YOU START DEALING WITH THE NEW VERSION.
The use of application callback doesn't abolish o.get_ErrorMsg(o.LastErrorCode) scheme to report error message to GUI, for example:
1. Deprecated members removed from API.
In this version for the first time a significant number of obsolete API members were removed from Map class. Here is the list of members. Most of those members had been marked as deprecated for quite some time in the documentation. For each such member a substitute is recommended in the docs. Also the definitions aren't permanently removed from the source but excluded by conditional compilation, so if this move will cause too much trouble for the existing apps it can be reverted or a separate version of MapWinGIS with full API can be released. If you have issues with this decision please make you case in the discussions section.2. Demo application.
MapWinGIS is now shipped with demo application which is dubbed MapWindow Lite. Any functionality that this demo provides, can be easily incorporated in your own applications. The source code for the app is available here. The source also includes Legend control and GUI to set properties and labels for vector layers (from MapWindow 4). They can be easily reused in you own projects as well. Just checkout the source and start your own coding (only prerequisites are .NET framework 4.0 and MapWinGIS installed).3. Application callback.
New GlobalSettings.ApplicationCallback property was added. Callback object assigned to this property intercepts errors in all MapWinGIS classes so there is no longer needed to assign GlobalCallback to individual instances. In some cases errors are reported to application callback ONLY so there is strong recommendation to use it in ANY MapWinGIS application, however small it may be. Here is the simplest implementation of callback in C#:// simplest implementation of callbackpublicclass MyCallback : ICallback { publicvoid Progress(string KeyOfSender, int Percent, string Message) { Debug.Print("{0}: {1}", Message, Percent); } publicvoid Error(string KeyOfSender, string ErrorMsg) { Debug.Print("MapWinGIS error: ", ErrorMsg); } } // let's assign this callback as early as possible during app's execution:var gs = new GlobalSettings(); gs.ApplicationCallback = new MyCallback();
The use of application callback doesn't abolish o.get_ErrorMsg(o.LastErrorCode) scheme to report error message to GUI, for example:
var sf = new Shapefile(); if (!sf.Open(@"d:\my_data.shp", null)) { MessageBox.Show("Failed to open shapefile: " + sf.get_ErrorMsg(sf.LastErrorCode)); }