PreviousValue() public static method

public static PreviousValue ( TriColorValue value ) : TriColorValue
value TriColorValue
return TriColorValue
Example #1
0
        protected override void OnKeyUp(KeyEventArgs e)
        {
            base.OnKeyUp(e);

            var newValue = value;

            if (!(e.Alt || e.Control || e.Shift))
            {
                if (e.KeyCode == Keys.Up)
                {
                    if (!TriColorValueHelper.IsFirst(newValue))
                    {
                        newValue  = TriColorValueHelper.PreviousValue(newValue);
                        e.Handled = true;
                    }
                }
                else if (e.KeyCode == Keys.Down)
                {
                    if (!TriColorValueHelper.IsLast(newValue))
                    {
                        newValue  = TriColorValueHelper.NextValue(newValue);
                        e.Handled = true;
                    }
                }
            }
            Value = newValue;
        }
 // Return the fragment for the previous value
 protected override IRawElementProviderFragment GetPreviousSibling()
 {
     if (!TriColorValueHelper.IsFirst(_value))
     {
         return(new TriColorFragmentProvider(
                    _control,
                    fragmentRoot,
                    TriColorValueHelper.PreviousValue(_value)));
     }
     return(null);
 }