コード例 #1
0
        private void hideToolStripMenuItem_Click(object sender, EventArgs e)
        {
            HideableProcess currentProc = lstBox_Process.SelectedItem as HideableProcess;

            if (currentProc != null)
            {
                currentProc.Hide();
            }
        }
コード例 #2
0
        private void killToolStripMenuItem_Click(object sender, EventArgs e)
        {
            HideableProcess currentProc = lstBox_Process.SelectedItem as HideableProcess;

            if (currentProc != null)
            {
                currentProc.Kill();
                lstBox_Process.Items.Remove(currentProc);
                lstBox_Process.SelectedIndex = -1;
            }
        }
コード例 #3
0
        private async void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (ofdSelect.ShowDialog() == DialogResult.OK)
            {
                HideableProcess hidProcess = new HideableProcess();
                hidProcess.StartInfo.FileName = ofdSelect.FileName;
                await hidProcess.Start();

                m_lstProcess.Add(hidProcess);
                lstBox_Process.Items.Add(hidProcess);
            }
        }
コード例 #4
0
 private void updateToolStripMenuItem_Click(object sender, EventArgs e)
 {
     for (int i = lstBox_Process.Items.Count - 1; i >= 0; i--)
     {
         HideableProcess currentProc = lstBox_Process.Items[i] as HideableProcess;
         if (currentProc == null)
         {
             continue;
         }
         if (currentProc.HasExited)
         {
             lstBox_Process.Items.Remove(currentProc);
         }
     }
 }
コード例 #5
0
 private void lstBox_Process_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (lstBox_Process.SelectedIndex >= 0)
     {
         HideableProcess currentProc = lstBox_Process.SelectedItem as HideableProcess;
         if (currentProc == null)
         {
             lstBox_Process.SelectedIndex = -1;
             return;
         }
         showToolStripMenuItem.Visible      = hideToolStripMenuItem.Visible =
             togleToolStripMenuItem.Visible = currentProc.IsHideable;
         selectedToolStripMenuItem.Visible  = true;
     }
     else
     {
         selectedToolStripMenuItem.Visible = false;
     }
 }