PageRenderTime 42ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/TEditXna/View/ChestSignEditorView.xaml.cs

https://github.com/Surfpup/Terraria-Map-Editor
C# | 44 lines | 37 code | 3 blank | 4 comment | 5 complexity | 86bbfd79d2f9db6e573bd9690cab9129 MD5 | raw file
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Data;
  8. using System.Windows.Documents;
  9. using System.Windows.Input;
  10. using System.Windows.Media;
  11. using System.Windows.Media.Imaging;
  12. using System.Windows.Navigation;
  13. using System.Windows.Shapes;
  14. namespace TEditXna.View
  15. {
  16. /// <summary>
  17. /// Interaction logic for ChestSignEditorView.xaml
  18. /// </summary>
  19. public partial class ChestSignEditorView : UserControl
  20. {
  21. public ChestSignEditorView()
  22. {
  23. InitializeComponent();
  24. }
  25. private void ValidateLines(object sender, KeyEventArgs e)
  26. {
  27. // Limit to 10 lines
  28. var tb = sender as TextBox;
  29. if (tb != null)
  30. {
  31. if (e.Key == Key.Enter)
  32. {
  33. if (tb.LineCount > 9)
  34. {
  35. e.Handled = true;
  36. }
  37. }
  38. }
  39. }
  40. }
  41. }