Exemplo n.º 1
0
 /// <summary>
 /// Initialization of window's elements.
 /// </summary>
 /// <param name="ProcToStart">Object for started process.</param>
 /// <param name="AppToStart">Object for started app.</param>
 public CreatProcWindow(Proc ProcToStart, CApp AppToStart)
 {
     _procToStart = ProcToStart;
     _appToStart = AppToStart;
     InitializeComponent();
     textBox1.Focus();
 }
Exemplo n.º 2
0
 /// <summary>
 /// Call starting new task.
 /// </summary>
 private void TaskStartButton_Click(object sender, RoutedEventArgs e)
 {
     Proc ProcToStart = new Proc();
     CApp AppToStart = new CApp();
     CreatProcWindow CrPrWind = new CreatProcWindow(ProcToStart, AppToStart);
     CrPrWind.ShowDialog();
     if (ProcToStart.Id != 0) // if new task has started
     {
         _procColl.Add(ProcToStart);
         _procColl = new List<Proc>(_procColl);
         ProcListView.ItemsSource = _procColl;
         if (AppToStart.Name != "") // if new task has window
         {
             _appColl.Add(AppToStart);
             _appColl = new List<CApp>(_appColl);
             AppListView.ItemsSource = _appColl;
         }
     }
 }
Exemplo n.º 3
0
        private void btnKill_Click(object sender, EventArgs e)
        {
            current = dgTaskManager.SelectedRows?[0].DataBoundItem as Proc;

            Process.GetProcessById(current.Pid).Kill();
        }