LayoutFarm.Demo_MultiLineText_WithSuggestion.textSurfaceListener_PreviewEnterKeyDown C# (CSharp) Method

textSurfaceListener_PreviewEnterKeyDown() private method

private textSurfaceListener_PreviewEnterKeyDown ( object sender, Text e ) : void
sender object
e Text
return void
        void textSurfaceListener_PreviewEnterKeyDown(object sender, Text.TextDomEventArgs e)
        {
            //accept selected text
            if (!listView.Visible || listView.SelectedIndex < 0)
            {
                return;
            }
            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;
        }
        static string GetString(char[] buffer, LayoutFarm.Composers.TextSplitBound bound)