Inheritance: System.EventArgs
Ejemplo n.º 1
0
 internal static void NotifyReplaceAll(TextSurfaceEventListener listener, TextDomEventArgs e)
 {
     if (listener.ReplacedAll != null)
     {
         listener.ReplacedAll(listener, e);
     }
 }
        void textSurfaceListener_PreviewArrowKeyDown(object sender, Text.TextDomEventArgs e)
        {
            //update selection in list box
            switch (e.key)
            {
            case UIKeys.Down:
            {
                if (listView.Visible && listView.SelectedIndex < listView.ItemCount - 1)
                {
                    listView.SelectedIndex++;
                    listView.EnsureSelectedItemVisible();
                    e.PreventDefault = true;
                }
            }
            break;

            case UIKeys.Up:
            {
                if (listView.Visible && listView.SelectedIndex > 0)
                {
                    listView.SelectedIndex--;
                    listView.EnsureSelectedItemVisible();
                    e.PreventDefault = true;
                }
            }
            break;
            }
        }
Ejemplo n.º 3
0
 internal static bool NotifyPreviewArrow(TextSurfaceEventListener listener, UIKeys key)
 {
     if (listener.PreviewArrowKeyDown != null)
     {
         TextDomEventArgs e = new TextDomEventArgs(key);
         listener.PreviewArrowKeyDown(listener, e);
         return(e.PreventDefault);
     }
     return(false);
 }
Ejemplo n.º 4
0
 internal static bool NotifyPreviewBackSpace(TextSurfaceEventListener listener)
 {
     if (listener.PreviewBackSpaceKeyDown != null)
     {
         TextDomEventArgs e = new TextDomEventArgs(UIKeys.Back);
         listener.PreviewBackSpaceKeyDown(listener, e);
         return(e.PreventDefault);
     }
     return(false);
 }
Ejemplo n.º 5
0
 void textSurfaceListener_PreviewEnterKeyDown(object sender, Text.TextDomEventArgs e)
 {
     //accept selected text
     if (!sgBox.Visible || sgBox.SelectedIndex < 0)
     {
         return;
     }
     sgBox_UserConfirmSelectedItem(null, EventArgs.Empty);
     e.PreventDefault = true;
 }
 internal static bool NotifyPreviewBackSpace(TextSurfaceEventListener listener)
 {
     if (listener.PreviewBackSpaceKeyDown != null)
     {
         TextDomEventArgs e = new TextDomEventArgs(UIKeys.Back);
         listener.PreviewBackSpaceKeyDown(listener, e);
         return e.PreventDefault;
     }
     return false;
 }
Ejemplo n.º 7
0
 internal static bool NotifyPreviewKeydown(TextSurfaceEventListener listener, char c)
 {
     if (listener.IsRegisterPreviewKeyDownChar(c))
     {
         if (listener.PreviewRegisteredKeyDown != null)
         {
             TextDomEventArgs e = new TextDomEventArgs(c);
             listener.PreviewRegisteredKeyDown(listener, e);
             return(e.PreventDefault);
         }
     }
     return(false);
 }
        void textSurfaceListener_PreviewEnterKeyDown(object sender, Text.TextDomEventArgs e)
        {
            //accept selected text

            if (textbox.CurrentTextSpan != null)
            {
                textbox.ReplaceCurrentTextRunContent(currentLocalText.Length,
                                                     (string)listView.GetItem(listView.SelectedIndex).Tag);

                //-------------------------------------
                //then hide suggestion list
                listView.ClearItems();
                listView.Visible = false;
                //--------------------------------------
            }

            e.PreventDefault = true;
        }
 void textSurfaceListener_PreviewEnterKeyDown(object sender, Text.TextDomEventArgs e)
 {
     //accept selected text
     if (!sgBox.Visible || sgBox.SelectedIndex < 0)
     {
         return;
     }
     if (textbox.CurrentTextSpan != null)
     {
         textbox.ReplaceCurrentTextRunContent(currentLocalText.Length,
                                              (string)sgBox.GetItem(sgBox.SelectedIndex).Tag);
         //-------------------------------------
         //then hide suggestion list
         sgBox.ClearItems();
         sgBox.Hide();
         //--------------------------------------
     }
     e.PreventDefault = true;
 }
        void textSurfaceListener_PreviewArrowKeyDown(object sender, Text.TextDomEventArgs e)
        {
            //update selection in list box
            switch (e.key)
            {
            case UIKeys.Down:
            {
                if (listView.SelectedIndex < listView.ItemCount - 1)
                {
                    listView.SelectedIndex++;
                }
            } break;

            case UIKeys.Up:
            {
                if (listView.SelectedIndex > 0)
                {
                    listView.SelectedIndex--;
                }
            } break;
            }
        }
Ejemplo n.º 11
0
 internal static void NotifyCharactersRemoved(TextSurfaceEventListener listener, TextDomEventArgs e)
 {
     if (listener.CharacterRemoved != null)
     {
         listener.CharacterRemoved(listener, e);
     }
 }
 internal static bool NotifyPreviewKeydown(TextSurfaceEventListener listener, char c)
 {
     if (listener.IsRegisterPreviewKeyDownChar(c))
     {
         if (listener.PreviewRegisteredKeyDown != null)
         {
             TextDomEventArgs e = new TextDomEventArgs(c);
             listener.PreviewRegisteredKeyDown(listener, e);
             return e.PreventDefault;
         }
     }
     return false;
 }
 internal static bool NotifyPreviewArrow(TextSurfaceEventListener listener, UIKeys key)
 {
     if (listener.PreviewArrowKeyDown != null)
     {
         TextDomEventArgs e = new TextDomEventArgs(key);
         listener.PreviewArrowKeyDown(listener, e);
         return e.PreventDefault;
     }
     return false;
 }
 internal static void NotifyReplaceAll(TextSurfaceEventListener listener, TextDomEventArgs e)
 {
     if (listener.ReplacedAll != null)
     {
         listener.ReplacedAll(listener, e);
     }
 }
 internal static void NotifyCharactersRemoved(TextSurfaceEventListener listener, TextDomEventArgs e)
 {
     if (listener.CharacterRemoved != null)
     {
         listener.CharacterRemoved(listener, e);
     }
 }