예제 #1
0
        private void ProcessCache_OnProcessKilled(object sender, ProcessUpdaterEventArgs e)
        {
            ProcessObject tempProcObj = new ProcessObject()
            {
                ProcessName = e.Name,
                Id          = e.ID
            };

            int removeIndex = listViewProcesses.Items.getIndexOfLVI(tempProcObj.ConvertToListViewItem());

            if (removeIndex >= 0)
            {
                listViewProcesses.Items.RemoveAt(removeIndex);
            }
        }
예제 #2
0
        private void ProcessCache_OnProcessStarted(object sender, ProcessUpdaterEventArgs e)
        {
            invoke(listViewProcesses, () =>
            {
                if (e.Instance != null)
                {
                    var lvi = e.Instance.ConvertToListViewItem();

                    listViewProcesses.Items.Add(lvi);
                    Debug.WriteLine("Index of " + e.Name + " " + listViewProcesses.Items.getIndexOfLVI(lvi));
                }
                else
                {
                    MessageBox.Show("Saved your ass, e.Instance was null!");
                }
            });
        }
예제 #3
0
 private void ProcessUpdater_OnProcessKilled(object sender, ProcessUpdaterEventArgs e)
 {
     MessageBox.Show($"Process killed {e.Name}");
 }
예제 #4
0
 private void ProcessUpdater_OnFailure(object sender, ProcessUpdaterEventArgs e)
 {
     MessageBox.Show($"Process couldn't be killed {e.Name}, reason:\n{e.Error.Message}");
 }