Exemplo n.º 1
0
        private void mgDevX_SortButton_Click(object sender, EventArgs e)
        {
            // Reset the state
            mgDevX_SortButtonState oldState = _currentState;

            if (_currentState == mgDevX_SortButtonState.None)
            {
                _currentState = mgDevX_SortButtonState.Ascending;
            }
            else if (_currentState == mgDevX_SortButtonState.Ascending)
            {
                _currentState = mgDevX_SortButtonState.Descending;
            }
            else if (_currentState == mgDevX_SortButtonState.Descending)
            {
                _currentState = mgDevX_SortButtonState.None;
            }

            ResetImageBasedOnState();                           // Reset the image based on state

            // Fire the event
            if (!this.DesignMode)
            {
                this.OnSortStateChanged(oldState, _currentState);
            }
        }
Exemplo n.º 2
0
 protected void OnSortStateChanged(mgDevX_SortButtonState oldState, mgDevX_SortButtonState newState)
 {
     if (SortStateChanged != null)
     {
         SortStateChanged(this, new mgDevX_SortButton_EventArgs(oldState, newState));
     }
 }
Exemplo n.º 3
0
 public mgDevX_SortButton_EventArgs(mgDevX_SortButtonState oldState, mgDevX_SortButtonState newState)
 {
     _newState = newState;
     _oldState = oldState;
 }