private void RandomButton_Click(object sender, EventArgs e) { int timeLength = this.RadioButton1.Checked ? -1 : (int)(this.TimeSizeNumeric.Value); this.ProcessData = ProcessController.CreateRandomProcesses( (int)this.ProcessNumNumeric.Value, timeLength, (int)this.MiniumArrivalNumeric.Value, (int)this.MaxiumArrivalNumeric.Value, (int)this.MiniumRunNumeric.Value, (int)this.MaxiumrunNumeric.Value, (int)this.MiniumPriorityNumeric.Value, (int)this.MaxiumPriorityNumeric.Value ); // Set the view to show details. ProcessListView.View = View.Details; // Allow the user to edit item text. ProcessListView.LabelEdit = true; // Allow the user to rearrange columns. ProcessListView.AllowColumnReorder = true; // Display grid lines. ProcessListView.GridLines = true; //Add the items to the ListView. ProcessListView.Items.Clear(); for (int i = 0; i < ProcessData.Count(); i++) { ListViewItem tmp = new ListViewItem(ProcessData[i].Name, 0); tmp.SubItems.Add(ProcessData[i].Createtime.ToString()); tmp.SubItems.Add(ProcessData[i].Cputime.ToString()); tmp.SubItems.Add(runningType == 3 ? ProcessData[i].Priority.ToString() : "-"); ProcessListView.Items.Add(tmp); } }
private void RandomButton_Click(object sender, EventArgs e) { int timeLength = this.radioButton1.Checked ? -1 : (int)(this.timeSizeNumeric.Value); this.ProcessData = ProcessController.CreateRandomProcesses( (int)this.processNumNumeric.Value, timeLength, (int)this.miniumArrivalNumeric.Value, (int)this.maxiumArrivalNumeric.Value, (int)this.miniumRunNumeric.Value, (int)this.maxiumrunNumeric.Value, (int)this.miniumPriorityNumeric.Value, (int)this.maxiumPriorityNumeric.Value ); // Set the view to show details. processListView.View = View.Details; // Allow the user to edit item text. processListView.LabelEdit = true; // Allow the user to rearrange columns. processListView.AllowColumnReorder = true; // Display check boxes. //listView1.CheckBoxes = true; // Select the item and subitems when selection is made. //listView1.FullRowSelect = true; // Display grid lines. processListView.GridLines = true; // Sort the items in the list in ascending order. // processListView.Sorting = SortOrder.Ascending; //Add the items to the ListView. processListView.Items.Clear(); for (int i = 0; i < ProcessData.Count(); i++) { ListViewItem tmp = new ListViewItem(ProcessData[i].Name, 0); tmp.SubItems.Add(ProcessData[i].Createtime.ToString()); tmp.SubItems.Add(ProcessData[i].Cputime.ToString()); tmp.SubItems.Add(runningType == 3 ? ProcessData[i].Priority.ToString() : "-"); processListView.Items.Add(tmp); } //processListView.Items.AddRange(new ListViewItem[] { item1, item2, item3 }); // Create two ImageList objects. //ImageList imageListSmall = new ImageList(); //ImageList imageListLarge = new ImageList(); }