geoslegend / winforms-geplugin-control-library

Automatically exported from code.google.com/p/winforms-geplugin-control-library
GNU General Public License v3.0
0 stars 0 forks source link

System.FormatException in GEEventArgs.cs #102

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Enable Common Language Runtime Exceptions
2. Run the application using the plugin
3. Exception occurs when the plugin is ready

What is the expected output? What do you see instead?
No exception.  System.FormatException - "Input string was not in a correct 
format."

What version of the product are you using? On what operating system?
6.2.2.6613
Windows 7 Professional Service Pack 1

Please provide any additional information below.

It appears the TryParse is expecting a value from the EventId enum class.

Current code [External.cs in Ready()]
this.OnPluginReady(this, new GEEventArgs("Ready", ge.getPluginVersion(), ge));

Changed to this
this.OnPluginReady(this, new GEEventArgs("Ready", "None", ge));

Original issue reported on code.google.com by tracyJan...@gmail.com on 25 Mar 2013 at 6:15

GoogleCodeExporter commented 8 years ago
Many thanks, I will take a look at this and make any changes as necessary. 

Original comment by fraser.c...@gmail.com on 25 Mar 2013 at 10:11

GoogleCodeExporter commented 8 years ago
Ok yes good catch! The GEEventArgs constructor looks like it should handle this 
- as Enum.TryParse will should default to EventId.None, however I think that 
there is an issue with the argument being a number in the format "6.2.2" - 
giving the error you saw.

Anyhow, the fix you suggested is the right thing here as the EventIds are 
really for mouse events. I think that if I get the time I will separate out 
what the GEEventArgs class handles into some less generic classes such as 
`PluginReadyEventArgs`, etc.

Anyhow, the fix you suggested has been made - thanks again.

Fraser

Original comment by fraser.c...@gmail.com on 25 Mar 2013 at 10:52