Esempio n. 1
0
        /**
         * <summary>Creates a new radiobutton within the given document context.</summary>
         */
        public RadioButton(
            string name,
            DualWidget[] widgets,
            string value
            ) : base(
                name,
                widgets[0]
                )
        {
            FlagsEnum flags = Flags; flags |= FlagsEnum.Radio; flags |= FlagsEnum.NoToggleToOff; Flags = flags;

            FieldWidgets fieldWidgets = Widgets;

            for (
                int index = 1,
                length = widgets.Length;
                index < length;
                index++
                )
            {
                fieldWidgets.Add(widgets[index]);
            }

            Value = value;
        }
Esempio n. 2
0
        /**
         * <summary>Creates a new radiobutton within the given document context.</summary>
         * <param name="name"></param>
         * <param name="widgets">Dual-state widgets representing the available options.</param>
         * <param name="value"></param>
         */
        public RadioButton(
            string name,
            Widget[] widgets,
            string value
            ) : base(name, widgets[0])
        {
            Flags = EnumUtils.Mask(
                EnumUtils.Mask(Flags, FlagsEnum.Radio, true),
                FlagsEnum.NoToggleToOff,
                true
                );

            FieldWidgets fieldWidgets = Widgets;

            for (int index = 1, length = widgets.Length; index < length; index++)
            {
                fieldWidgets.Add(widgets[index]);
            }

            Value = value;
        }