I am having a user select an element, and I need to be sure it is a polygon element before I label it. I know you can check to see if it is a TextElement, but I don't see any other type of element that you can check for? When it is created programmatically, you will only add the geometry to a GraphicElement, CIMGraphicElement, or just Element. There is no specific type of element for Polygon, Point, etc. that can be checked, as far as I can tell. In ArcObjects there were all sorts of element types.
I see in the Element class there is an internal typecalled LayoutElementType that contains the information I am after (This is not exposed, I am only looking inside of the definition of Element from the 3.3 SDK):
switch (ElementType)
{
case LayoutElementType.Line:
case LayoutElementType.BezierCurve:
case LayoutElementType.OpenLasso:
case LayoutElementType.Polygon:
case LayoutElementType.Rectangle:
case LayoutElementType.Circle:
case LayoutElementType.Ellipse:
case LayoutElementType.Lasso:
case LayoutElementType.Triangle:
case LayoutElementType.RightTriangle:
case LayoutElementType.Cross:
case LayoutElementType.X:
case LayoutElementType.RoundedRectangle:
case LayoutElementType.Arc:
case LayoutElementType.HalfCircle:
case LayoutElementType.Cloud:
case LayoutElementType.OneSidedLinearArrow:
case LayoutElementType.TwoSidedLinearArrow:
case LayoutElementType.OneSidedCurvedArrow:
case LayoutElementType.TwoSidedCurvedArrow:
case LayoutElementType.OneSidedBlockArrow:
case LayoutElementType.TwoSidedBlockArrow:
case LayoutElementType.SplinedText:
case LayoutElementType.PolygonParagraph:
case LayoutElementType.RectangleParagraph:
case LayoutElementType.CircleParagraph:
case LayoutElementType.EllipseParagraph:
case LayoutElementType.PolygonMapFrame:
case LayoutElementType.RectangleMapFrame:
case LayoutElementType.CircleMapFrame:
case LayoutElementType.EllipseMapFrame:
return true;
default:
return false;
}
If I missed anything please let me know!
Thanks