void gcc_init() { oGCC gcc = null; if (App.GetData().GCCs.Count > 0) { gcc = App.GetData().GCCs[0]; } else { string path = Environment.GetEnvironmentVariable("path").Split(';') .Select(x => x.ToLower()) .Where(x => x.Contains("mingw")) .Take(1) .SingleOrDefault(); if (!string.IsNullOrEmpty(path)) { if (path.EndsWith("\\bin")) { path = path.Substring(0, path.Length - 4); } gcc = gcc_LoadDefault(); } } if (gcc != null) { gcc_BindUI(gcc); } }
private void gcc_Cancel_Button_Click(object sender, EventArgs e) { oGCC gcc = gcc_LoadDefault(); gcc_BindUI(gcc); App.gcc_Update(gcc); }
void gcc_BindUI(oGCC gcc) { tabGCC.Tag = gcc; m_gcc_PathEnvironment = gcc.PathRoot; gcc_Label_Path.Text = gcc.PathRoot; gcc_Select_List.Text = gcc.Name; gcc_Binaries_ListItems_Bind(gcc); gcc_Libraries_ListItems_Bind(gcc); gcc_CppIncludes_ListItems_Bind(gcc); gcc_CIncludes_ListItems_Bind(gcc); }
private void gcc_CppIncludes_Remove_Button_Click(object sender, EventArgs e) { if (gcc_Binaries_ListItems.SelectedItem != null) { string _itemSelect = gcc_CppIncludes_ListItem.SelectedItem.ToString(); if (!string.IsNullOrEmpty(_itemSelect)) { oGCC gcc = (oGCC)tabGCC.Tag; gcc.Cpp_Includes.Remove(_itemSelect); gcc_CppIncludes_ListItems_Bind(gcc); } } }
private void gcc_CppIncludes_Add_Button_Click(object sender, EventArgs e) { using (var fbd = new FolderBrowserDialog()) { DialogResult result = fbd.ShowDialog(); if (result == DialogResult.OK && !string.IsNullOrEmpty(fbd.SelectedPath)) { oGCC gcc = (oGCC)tabGCC.Tag; gcc.Cpp_Includes.Add(fbd.SelectedPath.ToLower()); gcc_CppIncludes_ListItems_Bind(gcc); } } }
public static void gcc_Update(oGCC gcc) { switch (_app.GCCs.Count) { case 0: _app.GCCs.Add(gcc); break; case 1: _app.GCCs[0] = gcc; break; } }
void gcc_CppIncludes_ListItems_Bind(oGCC gcc) { gcc_CppIncludes_ListItem.DataSource = null; gcc_CppIncludes_ListItem.DataSource = gcc.Cpp_Includes; tabGCC.Tag = gcc; }
void gcc_Libraries_ListItems_Bind(oGCC gcc) { gcc_Libraries_ListItem.DataSource = null; gcc_Libraries_ListItem.DataSource = gcc.Libraries; tabGCC.Tag = gcc; }
public void update_GCC(oGCC o) { }