public static GetInstance ( ) : |
||
return |
public TriColorProvider(TriColorControl control) { _control = control; // Populate static properties // AddStaticProperty(UIA_PropertyIds.UIA_ControlTypePropertyId, UIA_ControlTypeIds.UIA_CustomControlTypeId); AddStaticProperty(UIA_PropertyIds.UIA_LocalizedControlTypePropertyId, "tri-color picker"); AddStaticProperty(UIA_PropertyIds.UIA_ProviderDescriptionPropertyId, "UIASamples: Tri-Color Provider"); AddStaticProperty(UIA_PropertyIds.UIA_HelpTextPropertyId, "This is a color picker for a choice of three colors. Use Up and Down arrows to move the selection between the colors."); // The WinForm name for this control makes a good Automation ID. AddStaticProperty(UIA_PropertyIds.UIA_AutomationIdPropertyId, _control.Name); AddStaticProperty(UIA_PropertyIds.UIA_IsKeyboardFocusablePropertyId, true); AddStaticProperty(UIA_PropertyIds.UIA_IsControlElementPropertyId, true); AddStaticProperty(UIA_PropertyIds.UIA_IsContentElementPropertyId, true); // Some properties are provided for me already by HWND provider // NativeWindowHandle, ProcessId, FrameworkId, IsEnabled, HasKeyboardFocus // Register for custom property ReadyStateSchema.GetInstance().Register(); // Register for custom pattern ColorSchema.GetInstance().Register(); // TEST: Register for test schema TestSchema.GetInstance().Register(); }
public override object GetPropertyValue(int propertyId) { if (propertyId == ReadyStateSchema.GetInstance().ReadyStateProperty.PropertyId) { return((_control.Value == TriColorValue.Green) ? "Ready" : "Not Ready"); } return(base.GetPropertyValue(propertyId)); }