public string GetRowAndColumn(int v1X, int v1Y, int v2X, int v2Y, int v3X, int v3Y) { string rowAndColumn = string.Empty; try { var v1 = new Vertex() { X = v1X, Y = v1Y }; var v2 = new Vertex() { X = v2X, Y = v2Y }; var v3 = new Vertex() { X = v3X, Y = v3Y }; var vertices = new List <Vertex>(3) { v1, v2, v3 }; var imageGrid = new ImageGrid(); rowAndColumn = imageGrid.GetRowAndColumn(vertices); } catch (ArgumentException argEx) //also covers ArgumentOutOfRangeException as descendant { HandleArgumentErrors("vertices", argEx); } return(rowAndColumn); }