The issue is that if an IProvider gives to VectorLayer features that are derived from Geometry the render method will fail. This happens because in VectorLayer.RenderGeometry, feature.GetType().Name will not be a Geometry class name and Enum.Parse on
GeometryType2 will fail.
In my project i have created a class named Infrastructure inheriting LineString. Feature.GetType().Name will return "Infrastructure" which is not a member of GeometryType2. The solution to this is to refer to Feature.GetType().BaseType.Name
which will eventually be "LineString". My IProvider adapter class recieves Infrastructure items and type-casts them as (Geometry)infr, and casting in C# does not erase information about the derived type.
A simple solution would be to place the Enum.Parse line in a Try-Catch block, and if an ArgumentNotFound exception is raised, try to Enum.Parse on the base type, but it is rather inefficient.
Any help appreciated,