Esempio n. 1
0
        /// <summary>
        /// Returns the length of the node value.
        /// </summary>
        /// <param name="node1">The first value</param>
        /// <param name="node2">The second value</param>
        /// <returns>The sum of the length of the nodes value.</returns>
        public static IntBox Length(StringBox par)
        {
            IntBox element = new IntBox("IntBox", "IntBox", null);

            element.Value = par.Value.Length;
            return(element);
        }
Esempio n. 2
0
 /// <summary>
 /// Determines whether the node1 value is lexicographically 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 lexicographically greater than node2 value, false otherwise</returns>
 public static bool Greater(StringBox node1, StringBox node2)
 {
     if (String.Compare(node1.Value, node2.Value) > 0)
     {
         return(true);
     }
     return(false);
 }
Esempio n. 3
0
        /// <summary>
        /// Create a new instance of the <see cref="StringBoxController"/> class initializing
        /// the object state
        /// </summary>
        /// <param name="element">The element representig the related <see cref="IntBox"/></param>
        /// <param name="enabled">A boolean value, textbox is editable if true, disabled otherwise</param>
        public StringBoxController(StringBox element, bool enabled)
            : base(enabled)
        {
            this.element = element;

            textbox      = new TextBox();
            textbox.Text = element.Value;
            textbox.Font = new Font("Tahoma", 8, FontStyle.Regular);

            //Events
            textbox.GotFocus  += OnGotFocus;
            textbox.LostFocus += OnLostFocus;

            // Enable/disable control's textbox according to the "enable" variable value
            textbox.Enabled = enabled;
            if (!textbox.Enabled)
            {
                textbox.Text = element.Value;
            }

            Content     = textbox;
            Title       = element.Name;
            Description = element.Description;
        }
Esempio n. 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(StringBox node1, StringBox node2)
 {
     return(node1.Value == node2.Value);
 }
Esempio n. 5
0
 ///<summary>
 /// Create a new instance of the <see cref="IntBoxController"/> class initializing
 /// the object state
 /// </summary>
 /// <param name="element">The element representig the related <see cref="StringBox"/></param>
 public StringBoxController(StringBox element)
     : this(element, true)
 {
 }