Exemplo n.º 1
0
        /// <summary>
        /// This method updates the processes.
        /// </summary>
        /// <param name="sender"> The sender. </param>
        /// <param name="e"> The processes. </param>
        private void UpdateProcesses(object sender, ProcessListEventArgs e)
        {
            List <ProcessContainerVM> temp = new List <ProcessContainerVM>();

            foreach (var item in e.List.NewProcesses)
            {
                ProcessContainerVM processContainerVM = new ProcessContainerVM(item);
                foreach (var item2 in this.Processes)
                {
                    if (item.Id == item2.Id && item2.IsChecked == true)
                    {
                        processContainerVM.IsChecked = true;
                    }
                }

                processContainerVM.OnBoolChanged    += this.ChangeBoolOfProcesses;
                processContainerVM.OnModulesChanged += this.ChangeModulesOfProcesses;
                temp.Add(processContainerVM);
            }

            this.Processes.Clear();

            this.ProcessCount = this.Processes.Count;

            foreach (var item in temp)
            {
                this.Processes.Add(item);
            }

            if (this.isChecked == true)
            {
                this.FireOnIsChecked(new ProcessContainerVMEventArgs(this.Processes));
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProcessContainerVMBoolEventArgs"/> class.
 /// </summary>
 /// <param name="e"> The <see cref="ProcessContainerVM"/>. </param>
 public ProcessContainerVMBoolEventArgs(ProcessContainerVM e)
 {
     this.ProcessContainerVM = e;
 }