コード例 #1
0
 public Form2(Proccess proccess, bool flagNewOrChange)
 {
     InitializeComponent();
     this.proccess = proccess;
     if (flagNewOrChange)
     {
         text_name.Text     = proccess.name;
         text_desc.Text     = proccess.desc;
         text_memory.Text   = proccess.memoryForProccess.ToString();
         text_priority.Text = proccess.priority.ToString();
         text_proc.Text     = proccess.proccessor_number.ToString();
         text_user.Text     = proccess.user.ToString();
     }
 }
コード例 #2
0
 public Form2(List <Proccess> proccesses, bool flagNewOrChange)
 {
     InitializeComponent();
     proccesses.Add(new Proccess("", 0, 0, 0, "", 0));
     this.proccess = proccesses[proccesses.Count - 1];
     if (flagNewOrChange)
     {
         text_name.Text     = proccess.name;
         text_desc.Text     = proccess.desc;
         text_memory.Text   = proccess.memoryForProccess.ToString();
         text_priority.Text = proccess.priority.ToString();
         text_proc.Text     = proccess.proccessor_number.ToString();
         text_user.Text     = proccess.user.ToString();
     }
 }
コード例 #3
0
        private void delete_proc_Click(object sender, EventArgs e)
        {
            if (dataGridView1.Rows.Count != 0 && dataGridView1.Rows != null)
            {
                if (dataGridView1.CurrentRow.Index < ((Сomputer)manager.listOfComputers[selectedIndex]).proccess.Count - 1)
                {
                    Proccess proc = ((Сomputer)manager.listOfComputers[selectedIndex]).proccess[dataGridView1.CurrentRow.Index];
                    ((Сomputer)manager.listOfComputers[selectedIndex]).proccess.Remove(proc);

                    inizialazeGrid(selectedIndex);
                }
            }
            else
            {
                MessageBox.Show("Сначала выберите процесс!!!", "Ошибка");
            }
        }