Sha256: 90a970bfff6b529521a7170a9ccbcd6ec7273306a327f289bb2af3609ac61d4e

Contents?: true

Size: 1.3 KB

Versions: 1

Compression:

Stored size: 1.3 KB

Contents

#pragma once
#include "AutomationControl.h"
#include "StringHelper.h"

using namespace System::Windows::Automation;

ref class AutomatedSelectList : public AutomationControl
{
public:
	AutomatedSelectList(const HWND windowHandle);
	AutomatedSelectList(const FindInformation& findInformation);
	bool SelectByIndex(const int whichItem);
	bool SelectByValue(const char* whichItem);
	bool GetValueByIndex(const int whichItem, char* comboValue, const int comboValueSize);

  property array<String^>^ Selection {
    array<String^>^ get();
  }

	property int Count {
		int get() { return SelectionItems->Count; }
	}

	property int SelectedIndex {
		int get();
	}

private:
	void Select(AutomationElement^ itemToSelect);

	property SelectionPattern^ AsSelectionPattern {
		SelectionPattern^ get() {
			return dynamic_cast<SelectionPattern^>(_control->GetCurrentPattern(SelectionPattern::Pattern));
		}
	}

	property AutomationElementCollection^ SelectionItems {
	  AutomationElementCollection^ get() { return _control->FindAll(System::Windows::Automation::TreeScope::Subtree, SelectionCondition); }
	}

	property PropertyCondition^ SelectionCondition {
	  PropertyCondition^ get() { return gcnew PropertyCondition(AutomationElement::IsSelectionItemPatternAvailableProperty, true); }
	}
};

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rautomation-0.9.0 ext/UiaDll/UiaDll/AutomatedSelectList.h