public ListForm(string name, FormStyle style, Home h, int root, string repo) { InitializeComponent(); addBtn.Text = "Ajouter " + name; m_name = name; m_style = style; m_h = h; m_root = root; m_repo = repo; }
private bool SetSections(string[] lines) { try { int nb = 0; for (int i = 0; i < lines.Length; i++) { if (lines[i].ToLower().Contains(KEY_SECTION)) { nb++; } } // get the number Sections = new string[nb]; Styles = new FormStyle[nb]; for (int i = 0; i < lines.Length; i++) { if (lines[i].ToLower().Contains(KEY_SECTION)) { string[] elements = lines[i].Split(':'); int id = int.Parse(elements[1]) - 1; Sections[id] = elements[2]; Styles[id] = new FormStyle(int.Parse(elements[3])); } } if (nb > 0) { return(true); } } catch (Exception) { } return(false); }