PageRenderTime 44ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VisualBasicEditorAutomationPeer.cs

http://github.com/mono/mono
C# | 35 lines | 33 code | 2 blank | 0 comment | 2 complexity | 5d7a9bd6a9a4492cd775bdb6c78f5303 MD5 | raw file
Possible License(s): GPL-2.0, CC-BY-SA-3.0, LGPL-2.0, MPL-2.0-no-copyleft-exception, LGPL-2.1, Unlicense, Apache-2.0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows.Automation.Peers;
  6. using System.Windows;
  7. using System.Runtime.InteropServices;
  8. using System.Xml.Linq;
  9. using System.Globalization;
  10. namespace System.Activities.Presentation.View
  11. {
  12. [System.Runtime.Fx.Tag.XamlVisible(false)]
  13. class VisualBasicEditorAutomationPeer : UIElementAutomationPeer
  14. {
  15. public VisualBasicEditorAutomationPeer(VisualBasicEditor owner)
  16. : base(owner)
  17. {
  18. }
  19. protected override string GetItemStatusCore()
  20. {
  21. VisualBasicEditor textBox = this.Owner as VisualBasicEditor;
  22. if (textBox != null)
  23. {
  24. XElement itemStatus = new XElement("VisualBasicEditorItemStatus",
  25. new XAttribute("Status", textBox.HasErrors ? "Invalid" : "Valid"),
  26. new XAttribute("EditingState", textBox.EditingState.ToString()),
  27. new XAttribute("ErrorMessage", String.IsNullOrEmpty(textBox.ErrorMessage) ? String.Empty : textBox.ErrorMessage));
  28. return itemStatus.ToString();
  29. }
  30. return base.GetItemStatusCore();
  31. }
  32. }
  33. }