Adding WpfBridge for automation of WPF and Silverlight

WpfBridge allows java to access .net 4 UI Automation libraries.  This
library enables Synthuse to access and automation WPF and Silverlight
apps.
This commit is contained in:
Edward Jakubowski
2014-04-03 22:29:36 -04:00
parent 2e1723f66e
commit d92f85e1b8
26 changed files with 1023 additions and 4 deletions

View File

@@ -0,0 +1,39 @@
/*
* Copyright 2014, Synthuse.org
* Released under the Apache Version 2.0 License.
*
* last modified by ejakubowski7@gmail.com
*/
#pragma once
public ref class WpfAutomation
{
public:
WpfAutomation(void);
void setFrameworkId(System::String ^propertyValue); //default is WPF, but also accepts Silverlight, Win32
//Descendants will walk the full tree of windows, NOT just one level of children
System::Int32 countDescendantWindows();
System::Int32 countDescendantWindows(System::String ^runtimeIdValue);
System::Int32 countChildrenWindows();
System::Int32 countChildrenWindows(System::String ^runtimeIdValue);
array<System::String ^> ^ enumChildrenWindowIds(System::String ^runtimeIdValue); //if runtimeIdValue is null will start at desktop
array<System::String ^> ^ enumDescendantWindowIds(System::String ^runtimeIdValue); //if runtimeIdValue is null will start at desktop
array<System::String ^> ^ enumDescendantWindowIds(System::Int32 processId);
array<System::String ^> ^ EnumDescendantWindowIdsFromHandle(System::IntPtr windowHandle);
//In all the above Enumerate methods will return a list of Runtime Ids for all related windows.
System::String ^getProperty(System::String ^propertyName, System::String ^runtimeIdValue);
array<System::String ^> ^ getProperties(System::String ^runtimeIdValue);
array<System::String ^> ^ getPropertiesAndValues(System::String ^runtimeIdValue);
private:
array<System::Int32> ^ convertRuntimeIdString(System::String ^runtimeIdValue);
System::Windows::Automation::AutomationElement ^ findAutomationElementById(System::String ^runtimeIdValue);
array<System::String ^> ^ getRuntimeIdsFromCollection(System::Windows::Automation::AutomationElementCollection ^collection);
static System::String ^DEFAULT_FRAMEWORK = L"WPF";
System::String ^frameworkId;
};