void but_Click(object sender, EventArgs e)
{
using (var gridui = new GridUI(this))
{
MissionPlanner.Utilities.ThemeManager.ApplyThemeTo(gridui);
if (Host.FPDrawnPolygon != null && Host.FPDrawnPolygon.Points.Count > 2)
{
gridui.ShowDialog();
}
else
{
if (
CustomMessageBox.Show("No polygon defined. Load a file?", "Load File", MessageBoxButtons.YesNo) ==
DialogResult.Yes)
{
gridui.LoadGrid();
gridui.ShowDialog();
}
else
{
CustomMessageBox.Show("Please define a polygon.", "Error");
}
}
}
}