AEMManager.AemManager.removeToolStripMenuItem_Click C# (CSharp) Method

removeToolStripMenuItem_Click() private method

private removeToolStripMenuItem_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        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();
              }
        }