Beispiel #1
0
        private bool IsEveryoneElseInTheGroupOff()
        {
            Control parent = this.Parent;

            if (parent == null)
            {
                return(true);
            }

            if ((GroupName != null) && (GroupName != ""))
            {
                foreach (Control c in parent.Controls)
                {
                    if (c is LightedButton2)
                    {
                        LightedButton2 lb = (LightedButton2)c;

                        // Check if anyone is turned on
                        if ((lb.GroupName != "") && (lb.GroupName == GroupName) && (lb != this))
                        {
                            if (lb.m_On)
                            {
                                return(false);
                            }
                        }
                    }
                }

                return(true);
            }

            return(false);
        }
Beispiel #2
0
        private void TurnOffOthersInTheGroup()
        {
            Control parent = this.Parent;

            if (parent == null)
            {
                return;
            }

            if ((GroupName != null) && (GroupName != ""))
            {
                foreach (Control c in parent.Controls)
                {
                    if (c is LightedButton2)
                    {
                        LightedButton2 lb = (LightedButton2)c;

                        // If we're turning the button on, the we need to make sure that others in the group
                        // are turned off
                        if ((lb.GroupName != "") && (lb.GroupName == GroupName) && (lb != this))
                        {
                            lb.On = false;
                        }
                    }
                }
            }
        }