windrobin / winforms-geplugin-control-library

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

Get geometry type from TreeNodeMouseClickEventArgs #47

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What should this feature enhancement do?

Regarding the event:

void kmlTreeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)

In the previous .NET 3.5 version, e.Node.Name would be "KmlPlacemark", 
"KmlPolygon", etc.  Now e.Node.Name is a unique key, and it looks like the type 
information is private (KmlTreeViewNode.ApiType).  Along the same lines this no 
longer works because Tag is now null:

kmlTreeNodeKPCCC = (KmlPlacemarkCoClassClass)e.Node.Tag;
kmlTreeNodeGeometry = kmlTreeNodeKPCCC.getGeometry();
kmlTreeNodeGeometryType = kmlTreeNodeGeometry.getType();

Are there any known workarounds that produce the similar results?

Maybe I just don't know the correct way to do this in the latest .NET 4.0 
version of the plugin...

Please provide any additional information below.

Original issue reported on code.google.com by kco...@gmail.com on 19 Aug 2011 at 11:06

GoogleCodeExporter commented 9 years ago
Hi, 

Yes, sorry, this is a bug as the access modifiers for the two properties you 
need in the KmlTreeViewNode are set to internal and should be public. This was 
a mistake that was introduced when the code for the nodes was taken out of the 
KmlTreeView class.

I need to set these two to public in  the next commit (will be this weekend)

internal dynamic ApiObject { get; private set; } 

internal string ApiObjectType { get; private set; }

You are also correct KmlTreeViewNode.Name is now set to the API objects ID 
rather than the objects type name. I introduced ApiObjectType property so that 
the value was still accessible...(doh!). This change was so that you can easily 
find a node in the tree from its API ID, there is now a simple function for 
this. 

public KmlTreeViewNode GetNodeById(string id)

So, I will commit the fix asap - thanks!

Fraser.

Original comment by fraser.c...@gmail.com on 20 Aug 2011 at 7:41

GoogleCodeExporter commented 9 years ago
...ok *this* weekend

Original comment by fraser.c...@gmail.com on 18 Sep 2011 at 4:43

GoogleCodeExporter commented 9 years ago
Fixed in the last commit 

Original comment by fraser.c...@gmail.com on 8 Oct 2011 at 12:51