public class Shape : AFPObject, IDisposable;
In the underlying C++ code wrapped by the C# AFP API Wrapper, Shape is the superclass for all other shape types (for example: Rectangle, Polygon). However, in the AFP API Wrapper, shapes like Rectangle and Polygon do not actually derive from Shape. Instead, most of the classes defining a kind of shape have a implicit cast to Shape. Hence, you can use one of those objects wherever a Shape is required--without needing an explicit cast. The difference in your code will be negligible, but the class inheritance hierarchy in the C# wrapper is greatly simplified.
ShapeEx.cs