Esempio n. 1
0
        /// <summary>
        /// Implements the negation of a BoolBox element
        /// </summary>
        /// <param name="par1">The element to negate</param>
        public static BoolBox Not(BoolBox par1)
        {
            BoolBox field = new BoolBox("BoolBox", "BoolBox", null);

            field.Value = !par1.Value.Value;
            return(field);
        }
Esempio n. 2
0
        /// <summary>
        /// Implements the OR operation between two BoolBox elements
        /// </summary>
        /// <param name="par1">The first Boolbox object</param>
        /// <param name="par2">The second one</param>
        public static BoolBox Or(BoolBox par1, BoolBox par2)
        {
            BoolBox field = new BoolBox("BoolBox", "BoolBox", null);

            field.Value = par1.Value.Value || par2.Value.Value;
            return(field);
        }
Esempio n. 3
0
        /// <summary>
        /// Create a new instance of the <see cref="BoolBoxController"/> class initializing
        /// the object state
        /// </summary>
        /// <param name="element">The element representig the related <see cref="BoolBox"/></param>
        /// <param name="enabled">A boolean value, check box is editable if true, disabled otherwise</param>
        public BoolBoxController(BoolBox element, bool enabled)
            : base(enabled)
        {
            this.element = element;

            checkbox         = new CheckBox();
            checkbox.Checked = element.Value == null ? false : element.Value.Value;

            // Enable/disable control's textbox according to the "enable" variable value
            checkbox.Enabled = enabled;

            Content     = checkbox;
            Title       = element.Name;
            Description = element.Description;
        }
Esempio n. 4
0
 /// <summary>
 /// Return true if a BoolBox element is checked, false otherwise.
 /// </summary>
 /// <param name="par1">The element to be analyzed</param>
 public static bool IsChecked(BoolBox par1)
 {
     return(par1.Value != null && par1.Value.Value);
 }
Esempio n. 5
0
 /// <summary>
 /// Overloaded constructor
 /// </summary>
 /// <param name="element">The element representig the related <see cref="BoolBox"/></param>
 public BoolBoxController(BoolBox element)
     : this(element, true)
 {
 }