private void btnOk_Click(object sender, EventArgs e)
{
SaveProperties();
TableSerializer.Save("lstMaps", lstMaps.SaveState());
if ((Loc.Pid!=LoadedPid)&&!LocParser.IsFreeLocationPID(Loc.Pid))
{
Message.Show("Location PID is already in use.", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (string.IsNullOrEmpty(Loc.Name))
{
Message.Show("You have to select a name for the location.", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (Loc.Maps.Count == 0)
{
Message.Show("The location has no maps.", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (Loc.Size == 0)
{
Message.Show("Location has no size.", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
this.Close();
}