예제 #1
0
 private void OnSortChanged()
 {
     if (SortChanged != null)
     {
         SortChanged.Invoke(this, EventArgs.Empty);
     }
 }
예제 #2
0
        protected virtual async Task OnSortChanged()
        {
            SortEventArgs args = new SortEventArgs();

            args.ColumnName = Grid.Settings.SortSettings.ColumnName;
            args.Direction  = Grid.Settings.SortSettings.Direction;

            if (SortChanged != null)
            {
                await SortChanged.Invoke(this, args);
            }
        }
예제 #3
0
        private void OnHyperLinkClick(object sender, RoutedEventArgs e)
        {
            object new_sort_hyperlink = sender;

            if (sort_hyperlink == new_sort_hyperlink)
            {
                reverse_sort_direction = !reverse_sort_direction;
            }
            else
            {
                reverse_sort_direction = false;
                sort_hyperlink         = new_sort_hyperlink;
            }

            SortChanged?.Invoke();
        }
예제 #4
0
        private void handleSortClick(HitInfo hitInfo)
        {
            FieldSortInfo sortInfo;

            if (!_sortIndexByField.TryGetValue(hitInfo.FieldName, out int sortIndex))
            {
                sortIndex = -1;
                sortInfo  = null;
            }
            else
            {
                sortInfo = _sortInfos[sortIndex];
            }


            if (ModifierKeys == Keys.None)
            {
                _sortInfos.Clear();
                _sortIndexByField.Clear();

                if (sortInfo == null)
                {
                    sortInfo = new FieldSortInfo(hitInfo.FieldName, SortOrder.Ascending);

                    _sortInfos.Add(sortInfo);
                    _sortIndexByField.Add(hitInfo.FieldName, _sortInfos.Count - 1);
                }
                else if (sortInfo.SortOrder == SortOrder.Ascending)
                {
                    sortInfo.SortOrder = SortOrder.Descending;
                    _sortInfos.Add(sortInfo);
                    _sortIndexByField.Add(hitInfo.FieldName, _sortInfos.Count - 1);
                }

                updateSort();
                SortChanged?.Invoke(this);
            }
            else if (ModifierKeys == Keys.Shift)
            {
                if (sortInfo == null)
                {
                    sortInfo = new FieldSortInfo(hitInfo.FieldName, SortOrder.Ascending);
                    _sortInfos.Add(sortInfo);
                    _sortIndexByField.Add(hitInfo.FieldName, _sortInfos.Count - 1);
                }
                else if (sortInfo.SortOrder == SortOrder.Ascending)
                {
                    sortInfo.SortOrder = SortOrder.Descending;
                }
                else if (sortInfo.SortOrder == SortOrder.Descending)
                {
                    _sortInfos.RemoveAt(sortIndex);
                    _sortIndexByField.Remove(hitInfo.FieldName);
                }

                updateSort();
                SortChanged?.Invoke(this);
            }
            else if (ModifierKeys == Keys.Control)
            {
                if (sortInfo != null)
                {
                    _sortInfos.RemoveAt(sortIndex);
                    _sortIndexByField.Remove(hitInfo.FieldName);

                    updateSort();
                    SortChanged?.Invoke(this);
                }
            }
        }
예제 #5
0
 protected void OnSortChanged(QueryOption obj, bool added)
 {
     SortChanged?.Invoke(obj, added);
 }
예제 #6
0
 public void Invalidate()
 {
     _sortedDocsByDefaultSort.Clear();
     SortChanged?.Invoke();
 }
예제 #7
0
 public void Invalidate()
 {
     _sortedCards = null;
     SortChanged?.Invoke();
 }