Ejemplo n.º 1
0
        protected virtual bool IsEmpty(System.Windows.Forms.Control input, object value)
        {
            EvaluateIsEmptyEventArgs args = new EvaluateIsEmptyEventArgs(input, value, this);
            OnEvaluateIsEmpty(args);
            if (args.IsEmptySet) return args.IsEmpty;

            if (value == null) return true;
            if (value is string)
            {
                if (_IsEmptyStringValid)
                    return value == null;
                else
                    return string.IsNullOrEmpty((string)value);
            }
            else if ((input is ComboBox || input is DevComponents.DotNetBar.Controls.ComboTree) && value is int)
                return ((int)value) < 0;

            return false;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Raises EvaluateIsEmpty event.
 /// </summary>
 /// <param name="args">Event Arguments</param>
 protected virtual void OnEvaluateIsEmpty(EvaluateIsEmptyEventArgs args)
 {
     EvaluateIsEmptyEventHandler h = EvaluateIsEmpty;
     if (h != null) h(this, args);
 }