public static new Polygon ReadFrom(System.IO.BinaryReader reader) { var result = new Polygon(); result.Vertices = new ColoredVertex[reader.ReadInt32()]; for (int i = 0; i < result.Vertices.Length; i++) { result.Vertices[i] = ColoredVertex.ReadFrom(reader); } return(result); }
public static new Polygon ReadFrom(System.IO.BinaryReader reader) { if (reader == null) { throw new System.ArgumentNullException(nameof(reader)); } var vertices = new ColoredVertex[reader.ReadInt32()]; for (var i = 0; i < vertices.Length; i++) { vertices[i] = ColoredVertex.ReadFrom(reader); } return(new Polygon(vertices)); }