/mcs/class/referencesource/System.Activities.Presentation/System.Activities.Presentation/System/Activities/Presentation/View/VisualBasicEditorAutomationPeer.cs
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
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Windows.Automation.Peers;
- using System.Windows;
- using System.Runtime.InteropServices;
- using System.Xml.Linq;
- using System.Globalization;
- namespace System.Activities.Presentation.View
- {
- [System.Runtime.Fx.Tag.XamlVisible(false)]
- class VisualBasicEditorAutomationPeer : UIElementAutomationPeer
- {
- public VisualBasicEditorAutomationPeer(VisualBasicEditor owner)
- : base(owner)
- {
- }
- protected override string GetItemStatusCore()
- {
- VisualBasicEditor textBox = this.Owner as VisualBasicEditor;
- if (textBox != null)
- {
- XElement itemStatus = new XElement("VisualBasicEditorItemStatus",
- new XAttribute("Status", textBox.HasErrors ? "Invalid" : "Valid"),
- new XAttribute("EditingState", textBox.EditingState.ToString()),
- new XAttribute("ErrorMessage", String.IsNullOrEmpty(textBox.ErrorMessage) ? String.Empty : textBox.ErrorMessage));
- return itemStatus.ToString();
- }
- return base.GetItemStatusCore();
- }
- }
- }