private void removeToolStripMenuItem_Click(object sender, EventArgs e)
{
AemInstance instance = this.SelectedInstanceInListview;
if (instance == null)
{
return;
}
if (MessageBox.Show(this, "Instance '" + instance.Name + "' will be removed.", "Remove intance", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
{
instance.NotifyIcon.Visible = false;
instance.NotifyIcon.Dispose();
instance.NotifyIcon = null;
instance.Delete();
Program.InstanceList.Remove(instance);
Program.UpdateInstanceListInViews();
}
}