示例#1
0
 /// <summary>
 /// Determines whether the node1 value is greater than node2 value.
 /// </summary>
 /// <param name="node1">The first value</param>
 /// <param name="node2">The second value</param>
 /// <returns>True if the node1 value is greater than node2 value, false otherwise</returns>
 public static bool After(CalendarBox par1, CalendarBox par2)
 {
     if (par1.Value == null || par2.Value == null)
     {
         return(false);
     }
     return(DateTime.Compare(par1.Value.Value, par2.Value.Value) > 0);
 }
示例#2
0
        /// <summary>
        /// Create a new instance of the <see cref="CalendarBoxController"/> class initializing
        /// the object state
        /// </summary>
        /// <param name="element">The element representig the related <see cref="CalendarBox"/></param>
        /// <param name="enabled">A boolean value, DatePicker is enabled if true, disabled otherwise</param>
        public CalendarBoxController(CalendarBox element, bool enabled)
            : base(enabled)
        {
            this.element = element;

            datePicker = new DateTimePicker();
            if (element.Value != null)
            {
                datePicker.Value = element.Value.Value;
            }

            datePicker.Font         = new Font("Tahoma", 8, FontStyle.Regular);
            datePicker.CalendarFont = new Font("Tahoma", 8, FontStyle.Regular);
            datePicker.Format       = DateTimePickerFormat.Short;
            //datePicker.CustomFormat = "dd/MM/yyyy";

            datePicker.Enabled = enabled;

            Content     = datePicker;
            Title       = element.Name;
            Description = element.Description;
        }
示例#3
0
 /// <summary>
 /// Overloaded contructor
 /// </summary>
 /// <param name="element">The element representig the related <see cref="CalendarBox"/>
 public CalendarBoxController(CalendarBox element) : this(element, true)
 {
 }
示例#4
0
 /// <summary>
 /// Determines whether the node1 value and node2 value have the same value.
 /// </summary>
 /// <param name="node1">The first value</param>
 /// <param name="node2">The second value</param>
 /// <returns>True if node1 value is equal than node2 value, false otherwise</returns>
 public static bool Equal(CalendarBox node1, CalendarBox node2)
 {
     return(node1.Value.Equals(node2.Value));
 }