我想将codedui用于Winform应用程序,其中某些窗口具有图形,但是默认情况下我无法超出图形页面。 Codede ui将控件类型识别为图形窗口的客户端。
因此,我想为其编写一个扩展,以下页面描述了一个扩展,它实现了一个从Control.ControlAccessibleObject派生的类,并重写AccessibilityObject属性以返回您的类的对象。我想问下该怎么办?以前有人对此有经验吗?
public partial class ChartControl : UserControl
{
// Overridden to return the custom AccessibleObject for the control.
protected override AccessibleObject CreateAccessibilityInstance()
{
return new ChartControlAccessibleObject(this);
}
// Inner class ChartControlAccessibleObject represents accessible information
// associated with the ChartControl and is used when recording tests.
public class ChartControlAccessibleObject : ControlAccessibleObject
{
ChartControl myControl;
public ChartControlAccessibleObject(ChartControl ctrl)
: base(ctrl)
{
myControl = ctrl;
}
}
}