uia 0.4.4 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +5 -0
- data/ext/UiaDll/UIA.Helper/Element.cs +11 -9
- data/ext/UiaDll/UIA.Helper/UIA.Helper.csproj +1 -0
- data/ext/UiaDll/UIA.Helper/Win32.cs +12 -0
- data/lib/uia/version.rb +1 -1
- metadata +5 -4
data/ChangeLog
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
using System;
|
2
2
|
using System.Collections.Generic;
|
3
|
+
using System.ComponentModel;
|
3
4
|
using System.Linq;
|
4
|
-
using System.Runtime.InteropServices;
|
5
5
|
using System.Windows.Automation;
|
6
6
|
|
7
7
|
namespace UIA.Helper
|
@@ -10,10 +10,6 @@ namespace UIA.Helper
|
|
10
10
|
{
|
11
11
|
private readonly AutomationElement _element;
|
12
12
|
|
13
|
-
[DllImport("user32")]
|
14
|
-
[return: MarshalAs(UnmanagedType.Bool)]
|
15
|
-
static extern bool IsWindow(IntPtr hWnd);
|
16
|
-
|
17
13
|
protected Element()
|
18
14
|
{
|
19
15
|
}
|
@@ -186,13 +182,19 @@ namespace UIA.Helper
|
|
186
182
|
public static Element ByRuntimeId(int[] runtimeId)
|
187
183
|
{
|
188
184
|
var condition = new PropertyCondition(AutomationElement.RuntimeIdProperty, runtimeId);
|
189
|
-
|
185
|
+
|
186
|
+
Element foundElement = null;
|
187
|
+
PotentialParentsOf(runtimeId)
|
188
|
+
.FirstOrDefault(x => null != (foundElement = x.FindFirst(TreeScope.Subtree, condition)));
|
189
|
+
|
190
|
+
return foundElement;
|
190
191
|
}
|
191
192
|
|
192
|
-
private static Element
|
193
|
+
private static IEnumerable<Element> PotentialParentsOf(IEnumerable<int> runtimeId)
|
193
194
|
{
|
194
|
-
|
195
|
-
|
195
|
+
return runtimeId.Where(x => Win32.IsWindow(x.IntPtr()))
|
196
|
+
.Select(x => ByHandle(x.IntPtr()))
|
197
|
+
.Concat(new[] {new RootElement()});
|
196
198
|
}
|
197
199
|
|
198
200
|
private static Element[] Find(AutomationElement element, TreeScope scope, Condition condition)
|
@@ -50,6 +50,7 @@
|
|
50
50
|
<Compile Include="Element.cs" />
|
51
51
|
<Compile Include="Extensions.cs" />
|
52
52
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
53
|
+
<Compile Include="Win32.cs" />
|
53
54
|
</ItemGroup>
|
54
55
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
55
56
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
data/lib/uia/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.5'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-05-
|
12
|
+
date: 2014-05-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
@@ -145,6 +145,7 @@ files:
|
|
145
145
|
- ext/UiaDll/UIA.Helper/Mouse.cs
|
146
146
|
- ext/UiaDll/UIA.Helper/Properties/AssemblyInfo.cs
|
147
147
|
- ext/UiaDll/UIA.Helper/UIA.Helper.csproj
|
148
|
+
- ext/UiaDll/UIA.Helper/Win32.cs
|
148
149
|
- ext/UiaDll/UiaDll.Test/AssemblyInfo.cpp
|
149
150
|
- ext/UiaDll/UiaDll.Test/ElementInformationTest.cpp
|
150
151
|
- ext/UiaDll/UiaDll.Test/ElementStub.h
|
@@ -262,7 +263,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
262
263
|
version: '0'
|
263
264
|
segments:
|
264
265
|
- 0
|
265
|
-
hash: -
|
266
|
+
hash: -806601741
|
266
267
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
267
268
|
none: false
|
268
269
|
requirements:
|
@@ -271,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
271
272
|
version: '0'
|
272
273
|
segments:
|
273
274
|
- 0
|
274
|
-
hash: -
|
275
|
+
hash: -806601741
|
275
276
|
requirements: []
|
276
277
|
rubyforge_project:
|
277
278
|
rubygems_version: 1.8.28
|