コード例 #1
0
        // *** Visibility CheckBox Management *** //
        // When a Checkbox has a relation visibility, if it is checked,
        // then the related controls, are visible. If not, then they aren't.
        public static void CheckBoxVisibility(object sender, EventArgs e)
        {
            CCheckBox control = sender as CCheckBox;

            foreach (ICustomControl related in control.cd.RelatedVisibility)
            {
                if (control.Checked || Model.getInstance().progMode)
                {
                    related.cd.Visible = true;
                }
                else
                {
                    if (related is CCheckBox || related is CComboBox)
                    {
                        SetDependentVisibility(related);
                    }
                    related.cd.Visible = false;
                }

                if (!related.cd.operatorVisibility && !Model.getInstance().progMode)
                {
                    related.cd.Visible = false;
                }
            }
        }
コード例 #2
0
ファイル: CustomHandler.cs プロジェクト: hucara/confmanager
        public void checkBoxToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CCheckBox checkBox = ControlFactory.BuildCCheckBox(model.currentClickedControl);

            editor = new ControlEditor();
            editor.Show(checkBox);
        }
コード例 #3
0
        //  *** Coupled CheckBox Management ***
        //  When a CheckBox is coupled with another one, the
        //  state of those must change at the same time to the same value.
        public static void CheckBoxCoupled(object sender, EventArgs e)
        {
            CCheckBox control = sender as CCheckBox;

            foreach (CCheckBox related in control.cd.CoupledControls.Where(r => r.cd.Type == "CCheckBox"))
            {
                related.CheckState = control.CheckState;

                //if (control.Checked) related.Enabled = false;
                //else related.Enabled = true;
            }
        }