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

http://github.com/mono/mono · C# · 35 lines · 33 code · 2 blank · 0 comment · 2 complexity · 2941042e1c08d0188ff9c3b8472e282d MD5 · raw file

  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. using System.Runtime;
  11. namespace System.Activities.Presentation.View
  12. {
  13. [Fx.Tag.XamlVisible(false)]
  14. class NamespaceDisplayAutomationPeer : UIElementAutomationPeer
  15. {
  16. public NamespaceDisplayAutomationPeer(NamespaceDisplay owner)
  17. : base(owner)
  18. {
  19. }
  20. protected override string GetItemStatusCore()
  21. {
  22. NamespaceDisplay namespaceDisplay = this.Owner as NamespaceDisplay;
  23. if (namespaceDisplay != null)
  24. {
  25. XElement itemStatus = new XElement("NamespaceStatus",
  26. new XAttribute("Status", namespaceDisplay.IsInvalid ? "Invalid" : "Valid"),
  27. new XAttribute("ErrorMessage", namespaceDisplay.ErrorMessage));
  28. return itemStatus.ToString();
  29. }
  30. return base.GetItemStatusCore();
  31. }
  32. }
  33. }