Esempio n. 1
0
        public void Handle(IEnumerable <IPopupEvent> events, CompletionPopupView view)
        {
            var current = events.First();

            if (!IsTriggered(current.Type, current.EventArgs, view.Target))
            {
                return;
            }

            PopupActions.Hide(view);
        }
Esempio n. 2
0
        public void Preview(IEnumerable <IPopupEvent> events, ICancellablePopupEvent current, CompletionPopupView view)
        {
            if (current.Type != EventType.CancellableInput || view.Target == null)
            {
                return;
            }

            if (!IsTriggered(current.EventArgs as TextCompositionEventArgs))
            {
                return;
            }

            PopupActions.Hide(view);
        }
Esempio n. 3
0
        public void Preview(IEnumerable <IPopupEvent> events, ICancellablePopupEvent current, CompletionPopupView view)
        {
            if (current.Type != EventType.CancellableInput || view.IsOpen)
            {
                return;
            }

            var args = current.EventArgs as TextCompositionEventArgs;

            if (args.Text.Length == 1 && triggers.Contains(args.Text[0]) && isBeginningOfExpression(args.Text[0]))
            {
                PopupActions.Show(view);
            }
        }
        public void Preview(IEnumerable <IPopupEvent> events, ICancellablePopupEvent current, CompletionPopupView view)
        {
            if (current.Source != EventSource.Popup || current.Type != EventType.ItemClicked)
            {
                return;
            }

            var eventArgs = current.EventArgs as ItemClickedEventArgs;

            InsertItem(eventArgs.CompletionItem);

            PopupActions.Hide(view);

            current.Cancel();
        }
Esempio n. 5
0
        public void Handle(IEnumerable <IPopupEvent> events, CompletionPopupView view)
        {
            var current = events.First();

            if (current.Type != EventType.SelectionChanged)
            {
                return;
            }

            if (IsTriggered(current.Type, current.EventArgs, view.Target))
            {
                PopupActions.Hide(view);
            }

            lastIndex = (int)current.EventArgs;
        }
        public void Handle(IEnumerable <IPopupEvent> events, CompletionPopupView view)
        {
            var current = events.First();

            if (current.Type != EventType.KeyUp || view.Target == null)
            {
                return;
            }

            if (!IsTriggered(current.EventArgs as KeyEventArgs))
            {
                return;
            }

            PopupActions.Hide(view);
        }
Esempio n. 7
0
 private void InsertItem(ICompletionItem item, CompletionPopupView view)
 {
     item.Insert();
     PopupActions.Hide(view);
 }