private void button2_Click_1(object sender, EventArgs e) { EditItems.Clear(); AddItems.Clear(); if (BJ.substance[Fname.SelectedIndex].GetType() == typeof(Bj_structure.function)) { Bj_structure.function temp = ((Bj_structure.function)BJ.substance[Fname.SelectedIndex]); temp.description = Fdescriptions.Text; temp.content = Fcontent.Text; BJ.substance[Fname.SelectedIndex] = temp; } else if (BJ.substance[Fname.SelectedIndex].GetType() == typeof(Bj_structure.comment)) { Bj_structure.comment temp = ((Bj_structure.comment)BJ.substance[Fname.SelectedIndex]); temp.comments = Fcontent.Text; BJ.substance[Fname.SelectedIndex] = temp; } else if (BJ.substance[Fname.SelectedIndex].GetType() == typeof(string)) { BJ.substance[Fname.SelectedIndex] = Fcontent.Text; } else if (BJ.substance[Fname.SelectedIndex].GetType() == typeof(ArrayList)) { MessageBox.Show("Unsupported Item!"); return; } MessageBox.Show("Success"); }
private void button7_Click(object sender, EventArgs e) { EditItems.Clear(); AddItems.Clear(); Bj_structure.comment item = new Bj_structure.comment(); item.comments = Fcontent.Text; item.index = BJ.commentCount; BJ.commentCount++; int ti = Fname.SelectedIndex; BJ.substance.Insert(ti + 1, item); ListBJNew(); Fname.SelectedIndex = ti + 1; }
public void AddCommentToBottom(ref Bj_structure inputbj, string comment) { Bj_structure.comment cs=new Bj_structure.comment(); string s=""; s += "//***************************************************************************" + Environment.NewLine; s += "//*" + Environment.NewLine; s += "//* " + comment + Environment.NewLine; s += "//*" + Environment.NewLine; s += "//***************************************************************************" + Environment.NewLine; s += Environment.NewLine; cs.comments=s; cs.index = inputbj.commentCount; inputbj.commentCount++; inputbj.substance.Add(cs); }
public void AddCommentToBottom(ref Bj_structure inputbj, string comment) { Bj_structure.comment cs = new Bj_structure.comment(); string s = ""; s += "//***************************************************************************" + Environment.NewLine; s += "//*" + Environment.NewLine; s += "//* " + comment + Environment.NewLine; s += "//*" + Environment.NewLine; s += "//***************************************************************************" + Environment.NewLine; s += Environment.NewLine; cs.comments = s; cs.index = inputbj.commentCount; inputbj.commentCount++; inputbj.substance.Add(cs); }
private void button7_Click(object sender, EventArgs e) { EditItems.Clear(); AddItems.Clear(); Functions_count.Text = "0"; New_functions_count.Text = "0"; Edited_functions_count.Text = "0"; Bj_structure.comment item = new Bj_structure.comment(); item.comments = Code.Text; item.index = BJ.commentCount; BJ.commentCount++; int ti = Functions_list.SelectedIndex; BJ.substance.Insert(ti + 1, item); ListBJNew(); Functions_list.SelectedIndex = ti + 1; ShowChanges(); }
private void button2_Click_1(object sender, EventArgs e) { EditItems.Clear(); AddItems.Clear(); Functions_count.Text = "0"; New_functions_count.Text = "0"; Edited_functions_count.Text = "0"; if (Functions_list.SelectedIndex == -1) { return; } else if (BJ.substance[Functions_list.SelectedIndex].GetType() == typeof(Bj_structure.function)) { Bj_structure.function temp = ((Bj_structure.function)BJ.substance[Functions_list.SelectedIndex]); temp.description = Descriptions.Text; temp.content = Code.Text; BJ.substance[Functions_list.SelectedIndex] = temp; } else if (BJ.substance[Functions_list.SelectedIndex].GetType() == typeof(Bj_structure.comment)) { Bj_structure.comment temp = ((Bj_structure.comment)BJ.substance[Functions_list.SelectedIndex]); temp.comments = Code.Text; BJ.substance[Functions_list.SelectedIndex] = temp; } else if (BJ.substance[Functions_list.SelectedIndex].GetType() == typeof(string)) { BJ.substance[Functions_list.SelectedIndex] = Code.Text; } else if (BJ.substance[Functions_list.SelectedIndex].GetType() == typeof(ArrayList)) { ShowChanges(); MessageBox.Show("Выберите функцию!", "Ошибка"); return; } ShowChanges(); MessageBox.Show("Сохранено.", "Готово"); }