本文整理汇总了C#中System.Windows.Input.TextCompositionEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# TextCompositionEventArgs类的具体用法?C# TextCompositionEventArgs怎么用?C# TextCompositionEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextCompositionEventArgs类属于System.Windows.Input命名空间,在下文中一共展示了TextCompositionEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
}
开发者ID:Tokeiburu,项目名称:RagnarokSDE,代码行数:7,代码来源:ScriptEditDialog.xaml.cs
示例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;
}
}
开发者ID:Saroko-dnd,项目名称:My_DZ,代码行数:7,代码来源:visualization.xaml.cs
示例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;
}
开发者ID:mokacao,项目名称:terminal-sharp,代码行数:7,代码来源:MainWindow.xaml.cs
示例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, "/") + ">");
}
}
开发者ID:hungdluit,项目名称:sipserver,代码行数:27,代码来源:EditXmlConfig.xaml.cs
示例5: edSQL_TextArea_TextEntered
private void edSQL_TextArea_TextEntered(object sender, TextCompositionEventArgs e)
{
if (e.Text == ".")
{
edSQL_TextArea_Sense(sender, e);
}
}
开发者ID:GDKsoftware,项目名称:QueryDesk,代码行数:7,代码来源:QueryEdit.xaml.cs
示例6: NumberBox_PreviewTextInput
private void NumberBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
if (new Regex("[^0-9.-]+").IsMatch(e.Text))
{
e.Handled = true;
}
}
开发者ID:Mumcio,项目名称:SidebarDiagnostics,代码行数:7,代码来源:Settings.xaml.cs
示例7: OnTextInput
protected override void OnTextInput(TextCompositionEventArgs e)
{
this.LastInputEvent = InputEvents.OnTextInput;
this.OnTextInserted(this, new TextInsertedEventArgs(e.Text, true, true));
this.ClearText();
}
开发者ID:Motaz-Al-Zoubi,项目名称:xaml-sdk,代码行数:7,代码来源:SogouCaret.cs
示例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();
}
}
开发者ID:peterschen,项目名称:SMAStudio,代码行数:26,代码来源:KeystrokeService.cs
示例9: PasswordBox_PreviewTextInput
private void PasswordBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
if (!char.IsNumber(e.Text.ToCharArray()[0]))
{
e.Handled = true;
}
}
开发者ID:Dorsorama,项目名称:Tuersteher2,代码行数:7,代码来源:LogIn.xaml.cs
示例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);
}
开发者ID:Imiolak,项目名称:TimeSheet,代码行数:7,代码来源:NewTimePeriodWindow.xaml.cs
示例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);
}
开发者ID:abdulbaruwa,项目名称:AdeTyper,代码行数:7,代码来源:GameOneView.xaml.cs
示例12: textBox3_TextInputStart
private void textBox3_TextInputStart(object sender, TextCompositionEventArgs e)
{
if (textBox1.Text == "Port")
{
textBox1.Text = "";
}
}
开发者ID:boricuaboy101,项目名称:WP7MPD,代码行数:7,代码来源:Login.xaml.cs
示例13: passwordBox1_TextInputStart
private void passwordBox1_TextInputStart(object sender, TextCompositionEventArgs e)
{
if (passwordBox1.Password == "******")
{
passwordBox1.Password = "";
}
}
开发者ID:boricuaboy101,项目名称:WP7MPD,代码行数:7,代码来源:Login.xaml.cs
示例14: textBox1_TextInput
private void textBox1_TextInput(object sender, TextCompositionEventArgs e)
{
if (textBox1.Text == "Server")
{
textBox1.Text = "";
}
}
开发者ID:boricuaboy101,项目名称:WP7MPD,代码行数:7,代码来源:Login.xaml.cs
示例15: textbox_PreviewTextInput
private void textbox_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
FileViewModel vm = DataContext as FileViewModel;
if (vm == null)
return;
vm.Modified = true;
}
开发者ID:caseymcspadden,项目名称:IRPSIM,代码行数:7,代码来源:FileView.xaml.cs
示例16: GridPreviewTextInput
private void GridPreviewTextInput(object sender, TextCompositionEventArgs e)
{
if(e.Source is TextBox
&& !((TextBox)e.Source).Name.Equals("Note")
&& !((TextBox)e.Source).Name.Equals("Barcode"))
e.Handled = !IsTextValid(e.Text);
}
开发者ID:DelLitt,项目名称:opmscoral,代码行数:7,代码来源:PurchaseOrderView.xaml.cs
示例17: value_PreviewTextInput
private void value_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
var tb = (TextBox)sender;
var text = tb.Text.Insert(tb.CaretIndex, e.Text);
e.Handled = !_numMatch.IsMatch(text);
}
开发者ID:Feliasfogg,项目名称:HomeWorks,代码行数:7,代码来源:NumericUpDownControl.xaml.cs
示例18: VisualElement_TextInput
void VisualElement_TextInput(object sender, TextCompositionEventArgs e) {
var array = keyProcessors;
foreach (var keyProcessor in array) {
if (keyProcessor.IsInterestedInHandledEvents || !e.Handled)
keyProcessor.TextInput(e);
}
}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:7,代码来源:KeyProcessorCollection.cs
示例19: textBox_OnPreviewTextInput
private static void textBox_OnPreviewTextInput(object sender, TextCompositionEventArgs e)
{
// 入力値が空白の場合は処理しない
if (string.IsNullOrEmpty(e.TextComposition.Text)) return;
if (RegexCheck.IsMatched(e.TextComposition.Text, GetInputCharcter((DependencyObject)sender)))
{
// 入力条件則に一致する場合は処理続行
e.Handled = false;
}
else
{
// Textプロパティを取得
PropertyInfo property = sender.GetType().GetProperty("Text");
// Textプロパティの値を取得
string value = (string)property.GetValue(sender);
// Textプロパティの値を置換
value = value.Replace(e.TextComposition.Text, string.Empty);
// Textプロパティの値を更新
property.SetValue(sender, value);
// ComboBoxのText対応
TextBox comboText = (TextBox)e.OriginalSource;
if (comboText != sender)
{
comboText.Text = value;
}
e.Handled = true;
}
}
开发者ID:higeneko2015,项目名称:WcfSample,代码行数:30,代码来源:InputCharcter.cs
示例20: TextInput
private void TextInput(object sender, TextCompositionEventArgs e)
{
string message = //"At: " + e.Timestamp.ToString() +
"Event: " + e.RoutedEvent + " " +
" Text: " + e.Text;
lstMessages.Items.Add(message);
}
开发者ID:ittray,项目名称:LocalDemo,代码行数:7,代码来源:KeyPressEvents.xaml.cs
注:本文中的System.Windows.Input.TextCompositionEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论