Example #1
0
        private void InitBasicSettings(VASLSettings settings)
        {
            foreach (var item in BasicSettings)
            {
                string   name     = item.Key.ToLower();
                CheckBox checkbox = item.Value;

                if (settings.IsBasicSettingPresent(name))
                {
                    VASLSetting setting = settings.BasicSettings[name];
                    checkbox.Enabled = true;
                    checkbox.Tag     = setting;
                    var value = setting.Value;

                    if (BasicSettingsState.ContainsKey(name))
                    {
                        value = BasicSettingsState[name];
                    }

                    checkbox.Checked = value;
                    setting.Value    = value;
                }
                else
                {
                    checkbox.Tag     = null;
                    checkbox.Enabled = false;
                    checkbox.Checked = false;
                }
            }
        }
Example #2
0
        // Custom Setting checked/unchecked (only after initially building the tree)
        private void settingsTree_AfterCheck(object sender, TreeViewEventArgs e)
        {
            // Update value in the ASLSetting object, which also changes it in the ASL script
            var         node    = (DropDownTreeNode)e.Node;
            VASLSetting setting = (VASLSetting)node.Tag;

            setting.Value = node.Checked;
            CustomSettingsState[setting.Id] = setting.Value;

            UpdateGrayedOut(node);
        }