/// <summary> /// Constructor /// </summary> public AccessFlags() { InitializeComponent(); // Get the flag dictionary flags = FlagManager.GetAccessFlagDict(); // Attach the checkboxes to the check changed event foreach (SmartCheckBox chk in flags.Values) { chk.CheckedChanged += new EventHandler(chk_CheckedChanged); } // Add all the rows for (int i = 0; i < flags.Count; i++) { tlpFlags.RowStyles.Add(new RowStyle(SizeType.AutoSize)); } // Add the first column of controls for (int i = 0; i < flags.Count - 10; i++) { tlpFlags.Controls.Add(flags.Values.ElementAt(i), 0, i); } // Add the second column of controls for (int i = 10; i < flags.Count; i++) { tlpFlags.Controls.Add(flags.Values.ElementAt(i), 1, i - 10); } }
private void chk_CheckedChanged(object sender, EventArgs e) { // Set the new flag string flagString = FlagManager.GetFlagString(flags); }