private void setAct(TuringAction act) { int num = act.Arract[0].Length + 1; for (int i = dataGridView1.ColumnCount; i < num; ++i) { int index = this.dataGridView1.Columns.Count; this.dataGridView1.Columns.Add("Q" + index, "Q" + index); this.dataGridView1.Columns["Q" + index].SortMode = DataGridViewColumnSortMode.NotSortable; } for (int i = 0; i < act.Arract.Length; ++i) { for (int j = 0; j < act.Arract[i].Length; ++j) { this.dataGridView1[j + 1, i].Value = act.Arract[i][j]; } } }
private TuringAction getAction() { TuringAction tuAct = new TuringAction(line.Alphabet); ActionT[][] act = new ActionT[this.dataGridView1.Rows.Count][]; for (int i = 0; i < this.dataGridView1.Rows.Count; i++) { act[i] = new ActionT[this.dataGridView1.Columns.Count - 1]; } for (int i = 0; i < this.dataGridView1.Rows.Count; ++i) { for (int j = 1; j < this.dataGridView1.Columns.Count; ++j) { act[i][j - 1] = (ActionT)this.dataGridView1.Rows[i].Cells[j].Value; } } tuAct.setAction(act); return(tuAct); }
public SaveData(SeveLine line, TuringAction act) { Line = line; Act = act; }