• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Windows.DataObjectPastingEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.DataObjectPastingEventArgs的典型用法代码示例。如果您正苦于以下问题:C# DataObjectPastingEventArgs类的具体用法?C# DataObjectPastingEventArgs怎么用?C# DataObjectPastingEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DataObjectPastingEventArgs类属于System.Windows命名空间,在下文中一共展示了DataObjectPastingEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: IntegerTextBox_PastingHandler

        private static void IntegerTextBox_PastingHandler(object sender, DataObjectPastingEventArgs e)
        {
            var Sender = sender as IntegerTextBox;
            if (Sender == null)
                return;

            Sender.OnPaste(e);
        }
开发者ID:ptownsend1984,项目名称:SampleApplications,代码行数:8,代码来源:IntegerTextBox.cs


示例2: OnPasted

        private void OnPasted(object sender, DataObjectPastingEventArgs e)
        {
            myWordsAdded = true;
            mySelectionStartPosition = Selection.Start;
            mySelectionEndPosition = Selection.IsEmpty ? Selection.End.GetPositionAtOffset(0, LogicalDirection.Forward) : Selection.End;

            // Hyperlink detection will be done in OnTextChanged()
        }
开发者ID:JackWangCUMT,项目名称:Plainion,代码行数:8,代码来源:RichTextEditor.cs


示例3: tb_Pasting

 private static void tb_Pasting(object sender, DataObjectPastingEventArgs e)
 {
     var pastedText = e.DataObject.GetData(typeof(string)) as string;
     if (!IsTextAllowed(pastedText))
     {
         e.CancelCommand();
     }
 }
开发者ID:skilldrill,项目名称:MCBattleShip,代码行数:8,代码来源:SingleDigitBehavior.cs


示例4: UcQuery_OnPaste

        private void UcQuery_OnPaste(object sender, DataObjectPastingEventArgs e)
        {
            var isText = e.SourceDataObject.GetDataPresent(DataFormats.UnicodeText, true);
            if (!isText) return;
            var text = e.SourceDataObject.GetData(DataFormats.UnicodeText) as string;

            ucQuery.Tag = !string.IsNullOrWhiteSpace(text);
        }
开发者ID:konradsikorski,项目名称:smartCAML,代码行数:8,代码来源:QueryTab.cs


示例5: Key_Pasting

 private void Key_Pasting(object sender, DataObjectPastingEventArgs e)
 {
     Regex r = new Regex("[^a-zA-Z]");
     if (r.IsMatch(e.DataObject.GetData(typeof(string)).ToString()))
     {
         MessageBox.Show(this, "Keys can only contain alphabetic letters!");
         e.CancelCommand();
     }
 }
开发者ID:ashfordl,项目名称:cipher-solver,代码行数:9,代码来源:MainWindow.xaml.cs


示例6: RichTextBox_Pasting

 private void RichTextBox_Pasting(object sender, DataObjectPastingEventArgs e)
 {
     RichTextBox richTextBox = sender as RichTextBox;
       string textData = (e.DataObject.GetData(DataFormats.UnicodeText) as string).Replace("\n", " ").Replace("\r", "");
       new TextRange(richTextBox.Selection.Start, richTextBox.Selection.End).Text = string.Empty;
       richTextBox.CaretPosition = richTextBox.CaretPosition.GetPositionAtOffset(0, LogicalDirection.Forward) ?? richTextBox.CaretPosition;
       richTextBox.CaretPosition.InsertTextInRun(textData);
       e.CancelCommand();
 }
开发者ID:unbearab1e,项目名称:FlattyTweet,代码行数:9,代码来源:SettingsView.cs


示例7: OnPaste

        private void OnPaste(object sender, DataObjectPastingEventArgs e)
        {
            var isText = e.SourceDataObject.GetDataPresent(System.Windows.DataFormats.Text, true);
            if (!isText) 
                return;

            var text = e.SourceDataObject.GetData(DataFormats.Text) as string;

        }
开发者ID:kakesu,项目名称:Procurement,代码行数:9,代码来源:ForumTemplate.xaml.cs


示例8: PastingHandler

 private static void PastingHandler(object sender, DataObjectPastingEventArgs e)
 {
     if (e.DataObject.GetDataPresent(typeof(String)))
     {
         var text = (String)e.DataObject.GetData(typeof(String));
         if (!IsTextAllowed(text)) e.CancelCommand();
     }
     else e.CancelCommand();
 }
开发者ID:ruisebastiao,项目名称:WPF-MVVM-With-Entity-Framework,代码行数:9,代码来源:TextBoxMaskBehavior.cs


示例9: IntegerPastingHandler

 public static void IntegerPastingHandler(ref object sender, ref DataObjectPastingEventArgs e)
 {
     if (e.DataObject.GetDataPresent(typeof(String)))
     {
         String text = (String)e.DataObject.GetData(typeof(String));
         if (!HandlingUserInput.IsIntegerText(text)) e.CancelCommand();
     }
     else e.CancelCommand();
 }
开发者ID:GandziukVI,项目名称:BreakJunctionsExperiment,代码行数:9,代码来源:HandlingUserInput.cs


示例10: OnPaste

        private void OnPaste(object sender, DataObjectPastingEventArgs e)
        {
            var pastedText = (string) e.SourceDataObject.GetData(DataFormats.UnicodeText);

            if (ProductIdIsNotValid(pastedText))
            {
                e.CancelCommand();
            }
        }
开发者ID:Havret,项目名称:CeneoETL,代码行数:9,代码来源:ETLView.xaml.cs


示例11: OnPaste

 private void OnPaste(object sender, DataObjectPastingEventArgs e)
 {
     if (!(sender is RichTextBox))
     return;
       string textData = e.DataObject.GetData(DataFormats.Text) as string;
       (sender as RichTextBox).Document.ContentEnd.InsertTextInRun(textData);
       (sender as RichTextBox).CaretPosition = (sender as RichTextBox).Document.ContentEnd;
       e.CancelCommand();
 }
开发者ID:unbearab1e,项目名称:FlattyTweet,代码行数:9,代码来源:SearchUserView.cs


示例12: noPaste

 private void noPaste(object sender, DataObjectPastingEventArgs e)
 {
     if (e.DataObject.GetDataPresent(typeof(String)))
     {
         String text = (String)e.DataObject.GetData(typeof(String));
         if (textAllowed(text)) e.CancelCommand();
     }
     else e.CancelCommand();
 }
开发者ID:trbielec,项目名称:hospipal,代码行数:9,代码来源:App.xaml.cs


示例13: OnClipboardPaste

 /// <summary>
 /// This method handles paste and drag/drop events onto the TextBox.  It restricts the character
 /// set to numerics and ensures we have consistent behavior.
 /// </summary>
 /// <param name="sender">TextBox sender</param>
 /// <param name="e">EventArgs</param>
 private static void OnClipboardPaste(object sender, DataObjectPastingEventArgs e)
 {
     string text = e.SourceDataObject.GetData(e.FormatToApply) as string;
     if (!string.IsNullOrEmpty(text))
     {
         if (text.Count(ch => !Char.IsNumber(ch)) == 0)
             return;
     }
     e.CancelCommand();
 }
开发者ID:nlafourcade,项目名称:OGP,代码行数:16,代码来源:NumericTextBoxBehavior.cs


示例14: IPTextBox_Paste

        private void IPTextBox_Paste(object sender, DataObjectPastingEventArgs e)
        {

            if (e.DataObject.GetDataPresent(typeof(string)))
            {
                string value = e.DataObject.GetData(typeof(string)).ToString();
                setIP(value);
            }

            e.CancelCommand();
        }
开发者ID:Stefanying,项目名称:CenterControlEditor,代码行数:11,代码来源:IPInput.xaml.cs


示例15: OnPaste

 protected virtual void OnPaste(DataObjectPastingEventArgs e)
 {
     var IsTextPresent = e.SourceDataObject.GetDataPresent(System.Windows.DataFormats.Text, true);
     if (IsTextPresent)
     {
         var TextValue = e.SourceDataObject.GetData(DataFormats.Text) as string;
         if (CheckTextFormat(TextValue))
             return;
     }
     e.CancelCommand();
 }
开发者ID:ptownsend1984,项目名称:SampleApplications,代码行数:11,代码来源:IntegerTextBox.cs


示例16: textBoxNumeric_Pasting

 private void textBoxNumeric_Pasting(object sender, DataObjectPastingEventArgs e)
 {
     string input = string.Empty;
     if (e.DataObject.GetDataPresent(typeof(string)))
     {
         if (!this.isNumericInput((string)e.DataObject.GetData(typeof(string))))
             e.CancelCommand();
     }
     else
         e.CancelCommand();
 }
开发者ID:Nefarin,项目名称:DadmProject,代码行数:11,代码来源:ECG_BASELINE.xaml.cs


示例17: TextBoxPastingEventHandler

 private static void TextBoxPastingEventHandler(object sender, DataObjectPastingEventArgs e)
 {
     var textBox = (sender as TextBox);
     var clipboard = e.DataObject.GetData(typeof(string)) as string;
     // TODO : clipboard = ValidateValue(clipboard);
     if (textBox != null && !string.IsNullOrEmpty(clipboard))
     {
         textBox.Text = clipboard;
     }
     e.CancelCommand();
     e.Handled = true;
 }
开发者ID:MaxMEllon,项目名称:AigisCapture,代码行数:12,代码来源:TextBoxBehavior.cs


示例18: CheckPasteFormat

 private void CheckPasteFormat(object sender, DataObjectPastingEventArgs e)
 {
     var isText = e.SourceDataObject.GetDataPresent(System.Windows.DataFormats.Text, true);
     if (isText)
     {
         var text = e.SourceDataObject.GetData(DataFormats.Text) as string;
         if (CheckFormat(text))
         {
             return;
         }
     }
     e.CancelCommand();
 }
开发者ID:Mohamed1976,项目名称:EasySplitAndMergePdf,代码行数:13,代码来源:IntegerTextBox.cs


示例19: TextBoxPasting

 private void TextBoxPasting(object sender, DataObjectPastingEventArgs e)
 {
     if (e.DataObject.GetDataPresent(typeof(String)))
     {
         var text = (String)e.DataObject.GetData(typeof(String));
         if (!IsTextAllowed(text))
         {
             e.CancelCommand();
         }
     }
     else
     {
         e.CancelCommand();
     }
 }
开发者ID:faisal-nstu,项目名称:WeightCalculatorWpfApp,代码行数:15,代码来源:MainWindow.xaml.cs


示例20: TextBoxPaste_CheckNumbers

 private void TextBoxPaste_CheckNumbers(object sender, DataObjectPastingEventArgs e)
 {
     if (e.DataObject.GetDataPresent(typeof(String)))
     {
         String text = (String)e.DataObject.GetData(typeof(String));
         if (!StringHelpers.IsTextAllowed(text))
         {
             e.CancelCommand();
         }
     }
     else
     {
         e.CancelCommand();
     }
 }
开发者ID:killerrin,项目名称:Frontier-The-Void-GMTools,代码行数:15,代码来源:RollDicePage.xaml.cs



注:本文中的System.Windows.DataObjectPastingEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Windows.DataTemplate类代码示例发布时间:2022-05-26
下一篇:
C# Windows.DataObject类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap