Beispiel #1
0
        private bool ProcessKeysUp(Key key)
        {
            bool   flag   = false;
            Legend legend = this.Owner;

            if (legend == null)
            {
                return(flag);
            }
            switch (key)
            {
            case Key.Return:
            case Key.Space:
                legend.FireItemClick(this);
                break;

            case Key.Prior:
                LegendItem legendItem1 = Enumerable.FirstOrDefault <LegendItem>(Enumerable.OfType <LegendItem>((IEnumerable)legend.Items), (Func <LegendItem, bool>)(item => item.IsInLegendVisibleArea(legend)));
                flag = legend.SetFocusToItem(legendItem1);
                break;

            case Key.Next:
                if (!this.IsInLegendVisibleArea(legend))
                {
                    LegendItem legendItem2 = Enumerable.FirstOrDefault <LegendItem>(Enumerable.OfType <LegendItem>((IEnumerable)legend.Items), (Func <LegendItem, bool>)(item => item.IsInLegendVisibleArea(legend)));
                    flag = legend.SetFocusToItem(legendItem2);
                    break;
                }
                LegendItem legendItem3 = (LegendItem)legend.Items[legend.Items.Count - 1];
                legend.SetFocusToItem(legendItem3);
                break;

            case Key.End:
                LegendItem legendItem4 = (LegendItem)legend.Items[legend.Items.Count - 1];
                flag = legend.SetFocusToItem(legendItem4);
                break;

            case Key.Home:
                LegendItem legendItem5 = (LegendItem)legend.Items[0];
                flag = legend.SetFocusToItem(legendItem5);
                break;
            }
            return(flag);
        }
Beispiel #2
0
 private bool TrySetFocusOnNextItem(Legend legend, bool isForward)
 {
     LegendItem nextItem = legend.GetNextItem(this, isForward);
     return legend.SetFocusToItem(nextItem);
 }
Beispiel #3
0
        private bool TrySetFocusOnNextItem(Legend legend, bool isForward)
        {
            LegendItem nextItem = legend.GetNextItem(this, isForward);

            return(legend.SetFocusToItem(nextItem));
        }