public void Init(configurationGroup group) { _group = group; txtPassword.Text = EncDec.DecryptData(group.password, MainForm.Conf.EncryptCode); if (_group.name == "Admin") { //force all features for admin user _group.featureset = 1; fpFeatures.Enabled = false; } Int64 i = 1; var feats = Enum.GetValues(typeof(Enums.Features)); foreach (var f in feats) { var cb = new CheckBox { Text = f.ToString(), Tag = f, AutoSize = true }; if ((Convert.ToInt64(f) & group.featureset) == i) { cb.Checked = true; } fpFeatures.Controls.Add(cb); i = i * 2; } }
public void Init(configurationGroup group) { _group = group; txtPassword.Text = EncDec.DecryptData(group.password,MainForm.Conf.EncryptCode); if (_group.name == "Admin") { //force all features for admin user _group.featureset = 1; fpFeatures.Enabled = false; } Int64 i = 1; var feats = Enum.GetValues(typeof(Enums.Features)); foreach (var f in feats) { var cb = new CheckBox { Text = f.ToString(), Tag = f, AutoSize = true, Checked = ((1L & @group.featureset) != 0 || (((long) f & @group.featureset) != 0)) }; fpFeatures.Controls.Add(cb); i = i * 2; } }