private void OnoptionsToolStripMenuItem_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) { e.ClickedItem.OwnerItem.Owner.Hide(); switch (e.ClickedItem.Name) { case "itemConvertToGrid25": var cgf = ConvertToGrid25Form.GetInstance(); cgf.MapLayer = _mapLayersHandler.CurrentMapLayer; if (!cgf.Visible) { cgf.Show(this); } else { cgf.BringToFront(); } break; case "itemAlwaysKeepOnTop": if (_mapLayersHandler.CurrentMapLayer != null) { ToolStripMenuItem tsmi = (ToolStripMenuItem)e.ClickedItem; tsmi.Checked = !tsmi.Checked; _mapLayersHandler.CurrentMapLayer.KeepOnTop = tsmi.Checked; } break; } }
public static ConvertToGrid25Form GetInstance() { if (_instance == null) { _instance = new ConvertToGrid25Form(); } return(_instance); }
private void OnConvertToGrid25Form_FormClosed(object sender, FormClosedEventArgs e) { _instance = null; global.SaveFormSettings(this); }