private void tracePolygon(IPolygon polygon)
{
// Check the polygon IS the envelope
if (!(polygon as IPolygon5).IsEnvelope)
{
System.Diagnostics.Debug.WriteLine("polygon IS NOT EQUAL to its envelope");
}
else
{
IEnvelope e = polygon.Envelope;
var coords = string.Format("XMin: {0}, YMin: {1}, XMax: {2}, YMax: {3}", e.XMin, e.YMin, e.XMax, e.YMax);
System.Diagnostics.Debug.WriteLine(coords);
}
// var sb = new StringBuilder();
//IPointCollection points = polygon as IPointCollection;
//IEnumVertex2 verticies = points.EnumVertices as IEnumVertex2;
//verticies.Reset();
////Get the next vertex.
//IPoint outVertex;
//int partIndex;
//int vertexIndex;
//System.Diagnostics.Debug.WriteLine("----------------------------------");
//verticies.Next(out outVertex, out partIndex, out vertexIndex);
//while (outVertex != null)
//{
// if (sb.Length > 0) { sb.Append(" | "); }
// sb.AppendFormat("X: {0}, Y: {1}", outVertex.X, outVertex.Y);
// verticies.Next(out outVertex, out partIndex, out vertexIndex);
//}
//System.Diagnostics.Debug.WriteLine(sb.ToString());
}