1 //----------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 //----------------------------------------------------------------
5 namespace System.Activities.Core.Presentation
9 using System.Windows.Automation.Peers;
11 [Fx.Tag.XamlVisible(false)]
12 class FlowchartExpressionAutomationPeer : UIElementAutomationPeer
14 const string ExpressionNotShown = "(null)";
15 AutomationPeer wrappedAutomationPeer;
17 public FlowchartExpressionAutomationPeer(FrameworkElement owner, AutomationPeer wrappedAutomationPeer)
20 this.wrappedAutomationPeer = wrappedAutomationPeer;
23 protected override string GetItemStatusCore()
25 Fx.Assert(this.Owner != null, "FlowchartExpressionAutomationPeer should have this.Owner != null.");
26 bool expressionShown = false;
27 if (this.Owner is FlowDecisionDesigner)
29 expressionShown = ((FlowDecisionDesigner)this.Owner).ExpressionShown;
33 Fx.Assert(this.Owner is FlowSwitchDesigner, "this.Owner should either be FlowDecisionDesigner or FlowSwitchDesigner.");
34 expressionShown = ((FlowSwitchDesigner)this.Owner).ExpressionShown;
36 return expressionShown ? FlowchartExpressionAdorner.GetExpressionString(this.Owner) : ExpressionNotShown;
39 protected override string GetClassNameCore()
41 return this.wrappedAutomationPeer.GetClassName();
44 protected override string GetNameCore()
46 return this.wrappedAutomationPeer.GetName();
49 protected override string GetAutomationIdCore()
51 return this.wrappedAutomationPeer.GetAutomationId();