ext/UiaDll/UiaDll/ElementStructures.h in uia-0.2.1 vs ext/UiaDll/UiaDll/ElementStructures.h in uia-0.3
- old
+ new
@@ -1,83 +1,8 @@
#pragma once
#include "ArrayHelper.h"
#include "StringHelper.h"
-#include <list>
-using namespace std;
-
-typedef struct _SearchCondition {
- int propertyId;
-
- int number;
- char* string;
- int* numbers;
- int numbersCount;
-
- _SearchCondition(const int id) : string(NULL), numbers(NULL) {
- Reset(id);
- }
-
- _SearchCondition(const int id, const char* s) : string(NULL), numbers(NULL) {
- Reset(id);
-
- auto length = strnlen_s(s, 10000);
- auto size = length + 1;
- this->string = new char[size];
- strcpy_s(this->string, size, s);
- }
-
- _SearchCondition(const int id, const int number) : string(NULL), numbers(NULL) {
- Reset(id);
- this->number = number;
- }
-
- _SearchCondition(const int id, list<const int>& numbers) : string(NULL), numbers(NULL) {
- Reset(id);
- numbersCount = numbers.size();
- this->numbers = new int[numbersCount];
-
- int index = 0;
- for(std::list<const int>::iterator number = numbers.begin(); number != numbers.end(); ++number, ++index) {
- this->numbers[index] = *number;
- }
- }
-
- bool HasNumbers() {
- return NULL != numbers;
- }
-
- bool IsString() {
- return NULL != string;
- }
-
- bool IsPatternAvailableProperty() {
- try {
- auto automationProperty = System::Windows::Automation::AutomationProperty::LookupById(propertyId);
- return automationProperty->ProgrammaticName->Contains("PatternAvailableProperty");
- } catch(Exception^ e) {
- Console::WriteLine(e->Message);
- return false;
- }
- }
-
- static _SearchCondition* FromControlTypes(list<const int>& controlTypes) {
- return new SearchCondition(System::Windows::Automation::AutomationElement::ControlTypeProperty->Id, controlTypes);
- }
-
- void Reset(const int id) {
- propertyId = id;
- delete[] string; delete[] numbers;
- string = NULL; numbers = NULL;
- number = 0; numbersCount = 0;
- }
-
- ~_SearchCondition() {
- Reset(propertyId);
- }
-
-} SearchCondition, *SearchConditionPtr;
-
typedef struct _ElementInformation {
int nativeWindowHandle;
int* runtimeId;
int runtimeIdLength;
char* name;