コード例 #1
0
        private bool uncheckThis()
        {
            // check if any other entry is checked instead?
            if (ParentEntry != null)
            {
                var siblings = ParentEntry.GetChildEntryList();
                if (siblings != null)
                {
                    foreach (var sibling in siblings)
                    {
                        if (
                            sibling != null &&
                            sibling != this &&
                            sibling is DialogEntry &&
                            ((DialogEntry)sibling).Type == DialogEntryType.RadioButton &&
                            ((DialogEntry)sibling).Status.HasFlag(DialogEntryStatus.Checked)
                            )
                        { // one other sibling was found that is checked, .. so we can uncheck this
                            _status &= ~DialogEntryStatus.Checked;
                            _status |= DialogEntryStatus.Unchecked;
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
コード例 #2
0
        private void checkThis()
        {
            _status &= ~DialogEntryStatus.Unchecked;
            _status |= DialogEntryStatus.Checked;

            // TODO:
            //  -   disable the others in this group [✓]
            //  -   or dialog [?] --> RadieoButtons must be within a group!
            if (ParentEntry != null)
            {
                var siblings = ParentEntry.GetChildEntryList();
                if (siblings != null)
                {
                    foreach (var sibling in siblings)
                    {
                        if (sibling != null &&
                            sibling != this &&
                            sibling is DialogEntry &&
                            ((DialogEntry)sibling).Type == DialogEntryType.RadioButton)
                        {
                            ((DialogEntry)sibling).Status |= DialogEntryStatus.Unchecked;
                        }
                    }
                }
            }
        }