PageRenderTime 38ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/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
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. 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. }