private void Project_COMBOBOX_SelectedIndexChanged(object sender, EventArgs e) { Path_TEXTBOX.Clear(); Methods_COMBOBOX.Items.Clear(); Info.Set_Cur_Project(Project_COMBOBOX.SelectedIndex); Read_Methods_File(Project_COMBOBOX.SelectedItem.ToString());//切换项目,读取相关项目的配置文件 }
private void Add_Project_BUTTON_Click(object sender, EventArgs e)//添加项目 { if (Add_Project_TEXTBOX.Text.IndexOfAny(new char[] { '\0', '\r', '\n', ' ' }) == 0 || Add_Project_TEXTBOX.Text.Equals("") == true) { DEBUG_TEXTBOX.AppendText("添加新项目错误!\r\n"); } else { this.Methods_COMBOBOX.Enabled = true; this.Add_Methods_BUTTON.Enabled = true; this.Add_Methods_TEXTBOX.Enabled = true; this.Delete_Methods_BUTTON.Enabled = true; Project_COMBOBOX.Items.Add(Add_Project_TEXTBOX.Text); Info.Add_Info(Add_Project_TEXTBOX.Text); int Pos = Info_Name.IndexOf(".ini"); Project_Name = Src_Project_Name.Insert(Pos + 1, Add_Project_TEXTBOX.Text); Project_Fs = new FileStream(Project_Name, FileMode.OpenOrCreate, FileAccess.ReadWrite); Project_Fs.Close(); File.SetAttributes(Project_Name, FileAttributes.Hidden); DEBUG_TEXTBOX.AppendText("创建" + Add_Project_TEXTBOX.Text + "项目配置文件\r\n"); Path_TEXTBOX.Clear(); Project_COMBOBOX.SelectedItem = Add_Project_TEXTBOX.Text; Add_Project_TEXTBOX.Clear(); } }
//方法选择列表 private void Methods_COMBOBOX_SelectedIndexChanged(object sender, EventArgs e) { Path_TEXTBOX.Clear(); Info.Set_Cur_Methods(Methods_COMBOBOX.SelectedIndex); List <String> List = Info.Get_Cur_Path_List(); for (int i = 0; i < List.Count; i++) { Path_TEXTBOX.AppendText(List[i] + "\n"); } }
private void Delete_Methods_BUTTON_Click(object sender, EventArgs e) { if (Methods_COMBOBOX.Items.Count > 0) { Methods_COMBOBOX.Items.RemoveAt(Info.Get_Cur_Methods()); Path_TEXTBOX.Clear(); Info.Del_Methods(); Methods_COMBOBOX.SelectedIndex = Info.Get_Cur_Methods(); if (Methods_COMBOBOX.Items.Count == 0) { Methods_COMBOBOX.Text = ""; } } }