Esempio n. 1
0
 /// <summary>
 ///     Raises the <see cref="CallTipClick"/> event.
 /// </summary>
 /// <param name="e">An <see cref="CallTipClickEventArgs"/> that contains the event data.</param>
 protected virtual void OnCallTipClick(CallTipClickEventArgs e)
 {
     EventHandler<CallTipClickEventArgs> handler = Events[_callTipClickEventKey] as EventHandler<CallTipClickEventArgs>;
     if (handler != null)
         handler(this, e);
 }
Esempio n. 2
0
        internal void FireCallTipClick(int arrow)
        {
            CallTipArrow a = (CallTipArrow)arrow;
            OverloadList ol = CallTip.OverloadList;
            CallTipClickEventArgs e;

            if (ol == null)
            {
                e = new CallTipClickEventArgs(a, -1, -1, null, CallTip.HighlightStart, CallTip.HighlightEnd);
            }
            else
            {
                int newIndex = ol.CurrentIndex;

                if (a == CallTipArrow.Down)
                {
                    if (ol.CurrentIndex == ol.Count - 1)
                        newIndex = 0;
                    else
                        newIndex++;
                }
                else if (a == CallTipArrow.Up)
                {
                    if (ol.CurrentIndex == 0)
                        newIndex = ol.Count - 1;
                    else
                        newIndex--;
                }

                e = new CallTipClickEventArgs(a, ol.CurrentIndex, newIndex, ol, CallTip.HighlightStart, CallTip.HighlightEnd);
            }

            OnCallTipClick(e);

            if (e.Cancel)
            {
                CallTip.Cancel();
            }
            else
            {
                if (ol != null)
                {
                    //	We allow them to alse replace the list entirely or just
                    //	manipulate the New Index
                    CallTip.OverloadList = e.OverloadList;
                    CallTip.OverloadList.CurrentIndex = e.NewIndex;
                    CallTip.ShowOverloadInternal();
                }

                CallTip.HighlightStart = e.HighlightStart;
                CallTip.HighlightEnd = e.HighlightEnd;
            }
        }