Example #1
0
        private void LoadSettings(IReadOnlyList <string> blacklist)
        {
            var type  = SettingsObject.GetType();
            var props = ReflectUtil.GetPropertiesCanWritePublicDeclared(type);

            if (ModifierKeys != Keys.Control)
            {
                props = props.Except(blacklist);
            }
            foreach (var p in props)
            {
                var state = ReflectUtil.GetValue(Settings.Default, p);
                switch (state)
                {
                case bool b:
                    var chk = GetCheckBox(p, b);
                    FLP_Settings.Controls.Add(chk);
                    FLP_Settings.SetFlowBreak(chk, true);
                    if (blacklist.Contains(p))
                    {
                        chk.ForeColor = Color.Red;
                    }
                    continue;
                }
            }
        }
Example #2
0
        private void LoadSettings(IEnumerable <string> blacklist)
        {
            var type  = SettingsObject.GetType();
            var props = ReflectUtil.GetPropertiesCanWritePublicDeclared(type).Except(blacklist);

            foreach (var p in props)
            {
                var state = ReflectUtil.GetValue(Settings.Default, p);
                switch (state)
                {
                case bool b:
                    var chk = GetCheckBox(p, b);
                    FLP_Settings.Controls.Add(chk);
                    FLP_Settings.SetFlowBreak(chk, true);
                    continue;
                }
            }
        }