本文整理汇总了C#中System.Windows.Input.TextCompositionEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# TextCompositionEventArgs类的具体用法?C# TextCompositionEventArgs怎么用?C# TextCompositionEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextCompositionEventArgs类属于System.Windows.Input命名空间,在下文中一共展示了TextCompositionEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: _textArea_TextEntering
private void _textArea_TextEntering(object sender, TextCompositionEventArgs e) {
if (e.Text.Length > 0 && _completionWindow != null) {
if (!char.IsLetterOrDigit(e.Text[0]) && e.Text[0] != '_') {
_completionWindow.CompletionList.RequestInsertion(e);
}
}
}
示例2: text_box_only_digits_PreviewTextInput
private void text_box_only_digits_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
if (!char.IsDigit(e.Text, e.Text.Length - 1))
{
e.Handled = true;
}
}
示例3: VideoTerminal_Main_PreviewTextInput
private void VideoTerminal_Main_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
string x = e.Text;
Console.WriteLine(e.Text);
VideoTerminal_Main.HandleClientData(e.Text);
e.Handled = true;
}
示例4: textEditor_TextEntered
private void textEditor_TextEntered(object sender, TextCompositionEventArgs e)
{
if (e.Text == "<" || e.Text == " ")
{
CompletionData[] completions1;
if (completions.TryGetValue("!" + e.Text + "!" + GetActiveElement(1), out completions1))
{
completionWindow = new CompletionWindow(textEditor.TextArea);
var completions2 = completionWindow.CompletionList.CompletionData;
foreach (var completion in completions1)
completions2.Add(completion);
completionWindow.Show();
completionWindow.Closed += delegate
{
completionWindow = null;
};
}
}
if (e.Text == ">")
{
var tag = GetOpenTag(1);
if (tag != string.Empty)
textEditor.Document.Insert(textEditor.CaretOffset, tag.Insert(1, "/") + ">");
}
}
示例5: edSQL_TextArea_TextEntered
private void edSQL_TextArea_TextEntered(object sender, TextCompositionEventArgs e)
{
if (e.Text == ".")
{
edSQL_TextArea_Sense(sender, e);
}
}
示例6: NumberBox_PreviewTextInput
private void NumberBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
if (new Regex("[^0-9.-]+").IsMatch(e.Text))
{
e.Handled = true;
}
}
示例7: OnTextInput
protected override void OnTextInput(TextCompositionEventArgs e)
{
this.LastInputEvent = InputEvents.OnTextInput;
this.OnTextInserted(this, new TextInsertedEventArgs(e.Text, true, true));
this.ClearText();
}
示例8: OnTextEntered
private void OnTextEntered(object sender, TextCompositionEventArgs e)
{
var ch = e.Text[0];
// Set last key stroke
_codeViewModel.LastKeyStroke = DateTime.Now;
// Notify our language context that the document is dirty and needs a reparsing
_languageContext.IsDirty = true;
// Update any parse errors to account for the new text inserted
var caretOffset = _textArea.Caret.Offset;
var lineText = _textArea.Document.GetText(_textArea.Document.GetLineByOffset(caretOffset));
Task.Run(() =>
{
_bookmarkManager.RecalculateOffsets(_textArea, BookmarkType.ParseError, caretOffset, e.Text.Length);
_bookmarkManager.RecalculateOffsets(_textArea, BookmarkType.AnalyzerInfo, caretOffset, e.Text.Length);
_bookmarkManager.RecalculateOffsets(_textArea, BookmarkType.AnalyzerWarning, caretOffset, e.Text.Length);
});
//if ((IsCodeCompletionTrigger(ch) || char.IsLetter(ch)) && _completionWindow == null)
if (_completionWindow == null && (IsCodeCompletionTrigger(ch) || string.IsNullOrEmpty(lineText.Trim())))// || IsCompletionPosition(caretOffset))
{
TriggerCompletion();
}
}
示例9: PasswordBox_PreviewTextInput
private void PasswordBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
if (!char.IsNumber(e.Text.ToCharArray()[0]))
{
e.Handled = true;
}
}
示例10: PreviewTextInput
private void PreviewTextInput(object sender, TextCompositionEventArgs e)
{
if ((sender as TextBox).Text.Length >= 2)
e.Handled = true;
else
e.Handled = !IsTextAllowed(e.Text);
}
示例11: GameOneView_TextInput
private void GameOneView_TextInput(object sender, TextCompositionEventArgs e)
{
var gameOneView = sender as GameOneView;
if(gameOneView == null) return;
var gameOneViewModel = gameOneView.DataContext as GameOneViewModel;
if (gameOneViewModel != null) gameOneViewModel.KeyPressReceivedCommand.Execute(e.Text);
}
示例12: textBox3_TextInputStart
private void textBox3_TextInputStart(object sender, TextCompositionEventArgs e)
{
if (textBox1.Text == "Port")
{
textBox1.Text = "";
}
}
示例13: passwordBox1_TextInputStart
private void passwordBox1_TextInputStart(object sender, TextCompositionEventArgs e)
{
if (passwordBox1.Password == "******")
{
passwordBox1.Password = "";
}
}
示例14: textBox1_TextInput
private void textBox1_TextInput(object sender, TextCompositionEventArgs e)
{
if (textBox1.Text == "Server")
{
textBox1.Text = "";
}
}
示例15: textbox_PreviewTextInput
private void textbox_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
FileViewModel vm = DataContext as FileViewModel;
if (vm == null)
return;
vm.Modified = true;
}