rautomation 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/History.rdoc +7 -1
  4. data/VERSION +1 -1
  5. data/ext/UiaDll/RAutomation.UIA/Controls/Clicker.cs +59 -0
  6. data/ext/UiaDll/RAutomation.UIA/Controls/SelectList.cs +76 -0
  7. data/ext/UiaDll/RAutomation.UIA/Controls/Spinner.cs +46 -0
  8. data/ext/UiaDll/RAutomation.UIA/Controls/TabControl.cs +54 -0
  9. data/ext/UiaDll/RAutomation.UIA/Controls/TableControl.cs +87 -0
  10. data/ext/UiaDll/RAutomation.UIA/Controls/TextControl.cs +50 -0
  11. data/ext/UiaDll/RAutomation.UIA/Expander.cs +59 -0
  12. data/ext/UiaDll/RAutomation.UIA/Extensions/Element.cs +108 -0
  13. data/ext/UiaDll/RAutomation.UIA/Extensions/Enumerable.cs +63 -0
  14. data/ext/UiaDll/RAutomation.UIA/Extensions/Property.cs +27 -0
  15. data/ext/UiaDll/RAutomation.UIA/Properties/AssemblyInfo.cs +36 -0
  16. data/ext/UiaDll/RAutomation.UIA/Properties/AutomationProperties.cs +18 -0
  17. data/ext/UiaDll/RAutomation.UIA/RAutomation.UIA.csproj +68 -0
  18. data/ext/UiaDll/UiaDll.sln +24 -2
  19. data/ext/UiaDll/UiaDll/ControlMethods.cpp +6 -5
  20. data/ext/UiaDll/UiaDll/DynamicAssemblyResolver.cpp +24 -0
  21. data/ext/UiaDll/UiaDll/DynamicAssemblyResolver.h +16 -0
  22. data/ext/UiaDll/UiaDll/{AutomationFinder.cpp → Locator.cpp} +25 -15
  23. data/ext/UiaDll/UiaDll/{AutomationFinder.h → Locator.h} +4 -2
  24. data/ext/UiaDll/UiaDll/MenuItemSelector.cpp +3 -3
  25. data/ext/UiaDll/UiaDll/MenuMethods.cpp +4 -0
  26. data/ext/UiaDll/UiaDll/SelectListMethods.cpp +40 -21
  27. data/ext/UiaDll/UiaDll/SpinnerMethods.cpp +61 -0
  28. data/ext/UiaDll/UiaDll/StringHelper.cpp +13 -1
  29. data/ext/UiaDll/UiaDll/StringHelper.h +1 -0
  30. data/ext/UiaDll/UiaDll/TabControlMethods.cpp +11 -8
  31. data/ext/UiaDll/UiaDll/TableMethods.cpp +20 -21
  32. data/ext/UiaDll/UiaDll/TextMethods.cpp +19 -17
  33. data/ext/UiaDll/UiaDll/UiaDll.cpp +191 -342
  34. data/ext/UiaDll/UiaDll/UiaDll.vcxproj +11 -21
  35. data/ext/UiaDll/UiaDll/UiaDll.vcxproj.filters +22 -115
  36. data/ext/UiaDll/UiaDll/dllmain.cpp +1 -21
  37. data/ext/UiaDll/UiaDll/stdafx.h +0 -2
  38. data/ext/WindowsForms/WindowsForms/DataEntryForm.Designer.cs +17 -0
  39. data/ext/WindowsForms/WindowsForms/DataEntryForm.cs +2 -6
  40. data/ext/WindowsForms/WindowsForms/MainFormWindow.Designer.cs +6 -7
  41. data/ext/WindowsForms/WindowsForms/MainFormWindow.cs +2 -0
  42. data/ext/WindowsForms/WindowsForms/UIA.Extensions.dll +0 -0
  43. data/ext/WindowsForms/WindowsForms/ValueMonthCalendar.cs +28 -0
  44. data/ext/WindowsForms/WindowsForms/WindowsForms.csproj +5 -4
  45. data/lib/rautomation/adapter/ms_uia.rb +1 -0
  46. data/lib/rautomation/adapter/ms_uia/control.rb +1 -13
  47. data/lib/rautomation/adapter/ms_uia/functions.rb +2 -16
  48. data/lib/rautomation/adapter/ms_uia/list_box.rb +2 -2
  49. data/lib/rautomation/adapter/ms_uia/spinner.rb +31 -0
  50. data/lib/rautomation/adapter/ms_uia/uia_dll.rb +59 -31
  51. data/lib/rautomation/adapter/ms_uia/window.rb +5 -4
  52. data/rautomation.gemspec +1 -0
  53. data/spec/adapter/ms_uia/spinner_spec.rb +44 -0
  54. data/spec/adapter/ms_uia/value_control_spec.rb +2 -2
  55. metadata +26 -25
  56. data/ext/UiaDll/UiaDll/AutomatedSelectList.cpp +0 -93
  57. data/ext/UiaDll/UiaDll/AutomatedSelectList.h +0 -47
  58. data/ext/UiaDll/UiaDll/AutomatedTabControl.cpp +0 -45
  59. data/ext/UiaDll/UiaDll/AutomatedTabControl.h +0 -41
  60. data/ext/UiaDll/UiaDll/AutomatedTable.cpp +0 -92
  61. data/ext/UiaDll/UiaDll/AutomatedTable.h +0 -35
  62. data/ext/UiaDll/UiaDll/AutomatedText.cpp +0 -22
  63. data/ext/UiaDll/UiaDll/AutomatedText.h +0 -26
  64. data/ext/UiaDll/UiaDll/AutomationClicker.cpp +0 -53
  65. data/ext/UiaDll/UiaDll/AutomationClicker.h +0 -30
  66. data/ext/UiaDll/UiaDll/AutomationControl.cpp +0 -40
  67. data/ext/UiaDll/UiaDll/AutomationControl.h +0 -75
  68. data/ext/UiaDll/UiaDll/ExpandCollapseHelper.cpp +0 -53
  69. data/ext/UiaDll/UiaDll/ExpandCollapseHelper.h +0 -25
  70. data/ext/UiaDll/UiaDll/SelectionItem.cpp +0 -10
  71. data/ext/UiaDll/UiaDll/SelectionItem.h +0 -21
  72. data/ext/UiaDll/UiaDll/Toggle.cpp +0 -2
  73. data/ext/UiaDll/UiaDll/Toggle.h +0 -22
  74. data/ext/UiaDll/UiaDll/globals.h +0 -3
  75. data/ext/WindowsForms/WindowsForms/AutomatableMonthCalendar.cs +0 -59
  76. data/ext/WindowsForms/WindowsForms/AutomationHelpers/AutomationProvider.cs +0 -91
@@ -70,6 +70,7 @@
70
70
  </ItemDefinitionGroup>
71
71
  <ItemGroup>
72
72
  <Reference Include="System" />
73
+ <Reference Include="System.Core" />
73
74
  <Reference Include="System.Data" />
74
75
  <Reference Include="System.Drawing" />
75
76
  <Reference Include="System.Windows.Forms" />
@@ -79,39 +80,25 @@
79
80
  <Reference Include="WindowsBase" />
80
81
  </ItemGroup>
81
82
  <ItemGroup>
82
- <ClInclude Include="AutomatedSelectList.h" />
83
- <ClInclude Include="AutomatedTabControl.h" />
84
- <ClInclude Include="AutomatedTable.h" />
85
- <ClInclude Include="AutomationClicker.h" />
86
- <ClInclude Include="AutomationControl.h" />
87
- <ClInclude Include="AutomationFinder.h" />
88
- <ClInclude Include="ExpandCollapseHelper.h" />
89
- <ClInclude Include="globals.h" />
83
+ <ClInclude Include="Locator.h" />
84
+ <ClInclude Include="DynamicAssemblyResolver.h" />
90
85
  <ClInclude Include="MenuItemSelector.h" />
91
86
  <ClInclude Include="resource.h" />
92
- <ClInclude Include="SelectionItem.h" />
93
87
  <ClInclude Include="Stdafx.h" />
94
88
  <ClInclude Include="StringHelper.h" />
95
89
  <ClInclude Include="targetver.h" />
96
- <ClInclude Include="AutomatedText.h" />
97
- <ClInclude Include="Toggle.h" />
98
90
  <ClInclude Include="UiaDll.h" />
99
91
  </ItemGroup>
100
92
  <ItemGroup>
101
93
  <ClCompile Include="AssemblyInfo.cpp" />
102
- <ClCompile Include="AutomatedSelectList.cpp" />
103
- <ClCompile Include="AutomatedTabControl.cpp" />
104
- <ClCompile Include="AutomatedTable.cpp" />
105
- <ClCompile Include="AutomationClicker.cpp" />
106
- <ClCompile Include="AutomationControl.cpp" />
107
- <ClCompile Include="AutomationFinder.cpp" />
94
+ <ClCompile Include="Locator.cpp" />
108
95
  <ClCompile Include="ControlMethods.cpp" />
96
+ <ClCompile Include="DynamicAssemblyResolver.cpp" />
109
97
  <ClCompile Include="MenuMethods.cpp" />
110
- <ClCompile Include="SelectionItem.cpp" />
111
98
  <ClCompile Include="SelectListMethods.cpp" />
112
99
  <ClCompile Include="dllmain.cpp" />
113
- <ClCompile Include="ExpandCollapseHelper.cpp" />
114
100
  <ClCompile Include="MenuItemSelector.cpp" />
101
+ <ClCompile Include="SpinnerMethods.cpp" />
115
102
  <ClCompile Include="Stdafx.cpp">
116
103
  <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
117
104
  <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
@@ -120,9 +107,7 @@
120
107
  <ClCompile Include="StringMethods.cpp" />
121
108
  <ClCompile Include="TabControlMethods.cpp" />
122
109
  <ClCompile Include="TableMethods.cpp" />
123
- <ClCompile Include="AutomatedText.cpp" />
124
110
  <ClCompile Include="TextMethods.cpp" />
125
- <ClCompile Include="Toggle.cpp" />
126
111
  <ClCompile Include="UiaDll.cpp" />
127
112
  </ItemGroup>
128
113
  <ItemGroup>
@@ -132,6 +117,11 @@
132
117
  <ItemGroup>
133
118
  <ResourceCompile Include="app.rc" />
134
119
  </ItemGroup>
120
+ <ItemGroup>
121
+ <ProjectReference Include="..\RAutomation.UIA\RAutomation.UIA.csproj">
122
+ <Project>{0834d9ae-b1aa-422b-b3b2-796c1c346301}</Project>
123
+ </ProjectReference>
124
+ </ItemGroup>
135
125
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
136
126
  <ImportGroup Label="ExtensionTargets">
137
127
  </ImportGroup>
@@ -13,51 +13,6 @@
13
13
  <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14
14
  <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15
15
  </Filter>
16
- <Filter Include="Header Files\Helpers">
17
- <UniqueIdentifier>{235d8022-1949-4a55-b1fd-af041c36744f}</UniqueIdentifier>
18
- </Filter>
19
- <Filter Include="Header Files\Table">
20
- <UniqueIdentifier>{1d8355de-7c5c-4443-b063-cdb96cd03444}</UniqueIdentifier>
21
- </Filter>
22
- <Filter Include="Header Files\Menu">
23
- <UniqueIdentifier>{f558a0f9-f67e-483f-86cf-a5f2ce6f1a93}</UniqueIdentifier>
24
- </Filter>
25
- <Filter Include="Source Files\Helpers">
26
- <UniqueIdentifier>{0639f7bf-9510-4ad0-8032-064ba24fed5a}</UniqueIdentifier>
27
- </Filter>
28
- <Filter Include="Source Files\Menu">
29
- <UniqueIdentifier>{ca87cbd9-97d0-41c0-b1d3-e0b4c6a3de8d}</UniqueIdentifier>
30
- </Filter>
31
- <Filter Include="Source Files\Table">
32
- <UniqueIdentifier>{9f1663a8-aadc-46f8-8b88-b50196b59645}</UniqueIdentifier>
33
- </Filter>
34
- <Filter Include="Source Files\SelectList">
35
- <UniqueIdentifier>{fe7c5a5a-36f1-4acb-9147-a32a4e168c5a}</UniqueIdentifier>
36
- </Filter>
37
- <Filter Include="Header Files\SelectList">
38
- <UniqueIdentifier>{b94fabb6-af2d-4628-b91f-837e271293aa}</UniqueIdentifier>
39
- </Filter>
40
- <Filter Include="Header Files\Strings">
41
- <UniqueIdentifier>{568b2839-5e30-4e34-91b0-a0e67f1c1672}</UniqueIdentifier>
42
- </Filter>
43
- <Filter Include="Source Files\Strings">
44
- <UniqueIdentifier>{4059b959-0144-4a0e-8900-fbdef8bbe335}</UniqueIdentifier>
45
- </Filter>
46
- <Filter Include="Source Files\Control">
47
- <UniqueIdentifier>{07c7f544-b01e-4f38-a4bb-adafe3b91fbd}</UniqueIdentifier>
48
- </Filter>
49
- <Filter Include="Header Files\Control">
50
- <UniqueIdentifier>{90616ecb-ce19-48d6-88ac-a38a46e42687}</UniqueIdentifier>
51
- </Filter>
52
- <Filter Include="Source Files\Text">
53
- <UniqueIdentifier>{15a04b2b-04c7-44f4-8fdb-d83019eb3917}</UniqueIdentifier>
54
- </Filter>
55
- <Filter Include="Header Files\Text">
56
- <UniqueIdentifier>{3b3c2b83-e423-4619-991a-ffd7f324ae62}</UniqueIdentifier>
57
- </Filter>
58
- <Filter Include="Source Files\TabControl">
59
- <UniqueIdentifier>{c8cf5521-2447-48f8-a48b-a4bf3909b00a}</UniqueIdentifier>
60
- </Filter>
61
16
  </ItemGroup>
62
17
  <ItemGroup>
63
18
  <ClInclude Include="UiaDll.h">
@@ -69,46 +24,19 @@
69
24
  <ClInclude Include="resource.h">
70
25
  <Filter>Header Files</Filter>
71
26
  </ClInclude>
72
- <ClInclude Include="globals.h">
73
- <Filter>Header Files</Filter>
74
- </ClInclude>
75
27
  <ClInclude Include="targetver.h">
76
28
  <Filter>Header Files</Filter>
77
29
  </ClInclude>
78
- <ClInclude Include="ExpandCollapseHelper.h">
79
- <Filter>Header Files\Helpers</Filter>
80
- </ClInclude>
81
- <ClInclude Include="AutomatedTable.h">
82
- <Filter>Header Files\Table</Filter>
83
- </ClInclude>
84
- <ClInclude Include="AutomationClicker.h">
85
- <Filter>Header Files\Helpers</Filter>
86
- </ClInclude>
87
- <ClInclude Include="AutomationFinder.h">
88
- <Filter>Header Files\Helpers</Filter>
89
- </ClInclude>
90
- <ClInclude Include="MenuItemSelector.h">
91
- <Filter>Header Files\Menu</Filter>
92
- </ClInclude>
93
- <ClInclude Include="AutomatedSelectList.h">
94
- <Filter>Header Files\SelectList</Filter>
30
+ <ClInclude Include="DynamicAssemblyResolver.h">
31
+ <Filter>Header Files</Filter>
95
32
  </ClInclude>
96
33
  <ClInclude Include="StringHelper.h">
97
- <Filter>Header Files\Strings</Filter>
98
- </ClInclude>
99
- <ClInclude Include="AutomationControl.h">
100
- <Filter>Header Files\Control</Filter>
101
- </ClInclude>
102
- <ClInclude Include="Toggle.h">
103
- <Filter>Header Files\Control</Filter>
104
- </ClInclude>
105
- <ClInclude Include="SelectionItem.h">
106
34
  <Filter>Header Files</Filter>
107
35
  </ClInclude>
108
- <ClInclude Include="AutomatedText.h">
109
- <Filter>Header Files\Text</Filter>
36
+ <ClInclude Include="Locator.h">
37
+ <Filter>Header Files</Filter>
110
38
  </ClInclude>
111
- <ClInclude Include="AutomatedTabControl.h">
39
+ <ClInclude Include="MenuItemSelector.h">
112
40
  <Filter>Header Files</Filter>
113
41
  </ClInclude>
114
42
  </ItemGroup>
@@ -125,61 +53,40 @@
125
53
  <ClCompile Include="dllmain.cpp">
126
54
  <Filter>Source Files</Filter>
127
55
  </ClCompile>
128
- <ClCompile Include="AutomatedTable.cpp">
129
- <Filter>Source Files\Table</Filter>
130
- </ClCompile>
131
- <ClCompile Include="AutomationClicker.cpp">
132
- <Filter>Source Files\Helpers</Filter>
56
+ <ClCompile Include="DynamicAssemblyResolver.cpp">
57
+ <Filter>Source Files</Filter>
133
58
  </ClCompile>
134
- <ClCompile Include="AutomationFinder.cpp">
135
- <Filter>Source Files\Helpers</Filter>
59
+ <ClCompile Include="ControlMethods.cpp">
60
+ <Filter>Source Files</Filter>
136
61
  </ClCompile>
137
- <ClCompile Include="ExpandCollapseHelper.cpp">
138
- <Filter>Source Files\Helpers</Filter>
62
+ <ClCompile Include="Locator.cpp">
63
+ <Filter>Source Files</Filter>
139
64
  </ClCompile>
140
65
  <ClCompile Include="MenuItemSelector.cpp">
141
- <Filter>Source Files\Menu</Filter>
142
- </ClCompile>
143
- <ClCompile Include="TableMethods.cpp">
144
- <Filter>Source Files\Table</Filter>
66
+ <Filter>Source Files</Filter>
145
67
  </ClCompile>
146
- <ClCompile Include="AutomatedSelectList.cpp">
147
- <Filter>Source Files\SelectList</Filter>
68
+ <ClCompile Include="MenuMethods.cpp">
69
+ <Filter>Source Files</Filter>
148
70
  </ClCompile>
149
71
  <ClCompile Include="SelectListMethods.cpp">
150
- <Filter>Source Files\SelectList</Filter>
151
- </ClCompile>
152
- <ClCompile Include="MenuMethods.cpp">
153
- <Filter>Source Files\Menu</Filter>
72
+ <Filter>Source Files</Filter>
154
73
  </ClCompile>
155
74
  <ClCompile Include="StringHelper.cpp">
156
- <Filter>Source Files\Strings</Filter>
75
+ <Filter>Source Files</Filter>
157
76
  </ClCompile>
158
77
  <ClCompile Include="StringMethods.cpp">
159
- <Filter>Source Files\Strings</Filter>
160
- </ClCompile>
161
- <ClCompile Include="AutomationControl.cpp">
162
- <Filter>Source Files\Control</Filter>
163
- </ClCompile>
164
- <ClCompile Include="ControlMethods.cpp">
165
- <Filter>Source Files\Control</Filter>
78
+ <Filter>Source Files</Filter>
166
79
  </ClCompile>
167
- <ClCompile Include="Toggle.cpp">
168
- <Filter>Source Files\Control</Filter>
80
+ <ClCompile Include="TabControlMethods.cpp">
81
+ <Filter>Source Files</Filter>
169
82
  </ClCompile>
170
- <ClCompile Include="SelectionItem.cpp">
83
+ <ClCompile Include="TableMethods.cpp">
171
84
  <Filter>Source Files</Filter>
172
85
  </ClCompile>
173
86
  <ClCompile Include="TextMethods.cpp">
174
- <Filter>Source Files\Text</Filter>
175
- </ClCompile>
176
- <ClCompile Include="AutomatedText.cpp">
177
- <Filter>Source Files\Text</Filter>
178
- </ClCompile>
179
- <ClCompile Include="TabControlMethods.cpp">
180
- <Filter>Source Files\TabControl</Filter>
87
+ <Filter>Source Files</Filter>
181
88
  </ClCompile>
182
- <ClCompile Include="AutomatedTabControl.cpp">
89
+ <ClCompile Include="SpinnerMethods.cpp">
183
90
  <Filter>Source Files</Filter>
184
91
  </ClCompile>
185
92
  </ItemGroup>
@@ -1,21 +1 @@
1
- // dllmain.cpp : Defines the entry point for the DLL application.
2
- #include "stdafx.h"
3
-
4
- IUIAutomation *pAutomation ;
5
-
6
- IUIAutomation* getGlobalIUIAutomation() {
7
- if( NULL == pAutomation ) {
8
- HRESULT hr ;
9
- hr = CoInitializeEx(NULL, COINIT_MULTITHREADED) ;
10
- if (FAILED(hr)) {
11
- printf("UiaDll: CoInitialize failed. hr = 0x%x", hr) ;
12
- return NULL;
13
- }
14
- hr = CoCreateInstance(__uuidof(CUIAutomation), NULL, CLSCTX_INPROC_SERVER, __uuidof(IUIAutomation), (void**)&pAutomation);
15
- if (FAILED(hr)) {
16
- printf("UiaDll: CoCreateInstance failed. hr = 0x%x", hr) ;
17
- return NULL;
18
- }
19
- }
20
- return pAutomation ;
21
- }
1
+ #include "stdafx.h"
@@ -16,8 +16,6 @@
16
16
 
17
17
  #include <list>
18
18
 
19
- #include "globals.h"
20
-
21
19
  using namespace System;
22
20
  using namespace System::Runtime::InteropServices;
23
21
  namespace UIAutomation = System::Windows::Automation;
@@ -46,7 +46,9 @@
46
46
  this.maskedTextBox1 = new System.Windows.Forms.MaskedTextBox();
47
47
  this.label1 = new System.Windows.Forms.Label();
48
48
  this.maskedTextBox2 = new System.Windows.Forms.MaskedTextBox();
49
+ this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
49
50
  this.groupBox3.SuspendLayout();
51
+ ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
50
52
  this.SuspendLayout();
51
53
  //
52
54
  // deleteItemButton
@@ -150,11 +152,24 @@
150
152
  this.maskedTextBox2.TabIndex = 14;
151
153
  this.maskedTextBox2.ValidatingType = typeof(System.DateTime);
152
154
  //
155
+ // numericUpDown1
156
+ //
157
+ this.numericUpDown1.Location = new System.Drawing.Point(574, 38);
158
+ this.numericUpDown1.Minimum = new decimal(new int[] {
159
+ 100,
160
+ 0,
161
+ 0,
162
+ -2147483648});
163
+ this.numericUpDown1.Name = "numericUpDown1";
164
+ this.numericUpDown1.Size = new System.Drawing.Size(120, 20);
165
+ this.numericUpDown1.TabIndex = 15;
166
+ //
153
167
  // DataEntryForm
154
168
  //
155
169
  this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
156
170
  this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
157
171
  this.ClientSize = new System.Drawing.Size(724, 474);
172
+ this.Controls.Add(this.numericUpDown1);
158
173
  this.Controls.Add(this.maskedTextBox2);
159
174
  this.Controls.Add(this.label1);
160
175
  this.Controls.Add(this.maskedTextBox1);
@@ -166,6 +181,7 @@
166
181
  this.ShowInTaskbar = false;
167
182
  this.Text = "DataEntryForm";
168
183
  this.groupBox3.ResumeLayout(false);
184
+ ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
169
185
  this.ResumeLayout(false);
170
186
  this.PerformLayout();
171
187
 
@@ -184,5 +200,6 @@
184
200
  private System.Windows.Forms.Label label1;
185
201
  private System.Windows.Forms.ColumnHeader columnState;
186
202
  private System.Windows.Forms.MaskedTextBox maskedTextBox2;
203
+ private System.Windows.Forms.NumericUpDown numericUpDown1;
187
204
  }
188
205
  }
@@ -1,11 +1,6 @@
1
1
  using System;
2
- using System.Collections.Generic;
3
- using System.ComponentModel;
4
- using System.Data;
5
- using System.Drawing;
6
- using System.Linq;
7
- using System.Text;
8
2
  using System.Windows.Forms;
3
+ using UIA.Extensions;
9
4
 
10
5
  namespace WindowsForms
11
6
  {
@@ -14,6 +9,7 @@ namespace WindowsForms
14
9
  public DataEntryForm()
15
10
  {
16
11
  InitializeComponent();
12
+ numericUpDown1.AsRangeValue();
17
13
  }
18
14
 
19
15
  private void closeDataEntryFormButton_Click(object sender, EventArgs e)
@@ -69,7 +69,7 @@
69
69
  this.treeView = new System.Windows.Forms.TreeView();
70
70
  this.multiLineTextField = new System.Windows.Forms.TextBox();
71
71
  this.buttonDataGridView = new System.Windows.Forms.Button();
72
- this.automatableMonthCalendar1 = new WindowsForms.AutomatableMonthCalendar();
72
+ this.automatableMonthCalendar1 = new System.Windows.Forms.MonthCalendar();
73
73
  this.groupBox1.SuspendLayout();
74
74
  this.groupBox2.SuspendLayout();
75
75
  this.menuStrip1.SuspendLayout();
@@ -428,18 +428,17 @@
428
428
  //
429
429
  // automatableMonthCalendar1
430
430
  //
431
- this.automatableMonthCalendar1.Location = new System.Drawing.Point(142, 474);
432
- this.automatableMonthCalendar1.MaxSelectionCount = 1;
431
+ this.automatableMonthCalendar1.Location = new System.Drawing.Point(142, 477);
433
432
  this.automatableMonthCalendar1.Name = "automatableMonthCalendar1";
434
- this.automatableMonthCalendar1.TabIndex = 17;
433
+ this.automatableMonthCalendar1.TabIndex = 19;
435
434
  //
436
435
  // MainFormWindow
437
436
  //
438
437
  this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
439
438
  this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
440
439
  this.ClientSize = new System.Drawing.Size(657, 657);
441
- this.Controls.Add(this.buttonDataGridView);
442
440
  this.Controls.Add(this.automatableMonthCalendar1);
441
+ this.Controls.Add(this.buttonDataGridView);
443
442
  this.Controls.Add(this.multiLineTextField);
444
443
  this.Controls.Add(this.treeView);
445
444
  this.Controls.Add(this.FruitListBox);
@@ -507,8 +506,8 @@
507
506
  private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem1;
508
507
  private System.Windows.Forms.TreeView treeView;
509
508
  private System.Windows.Forms.TextBox multiLineTextField;
510
- private AutomatableMonthCalendar automatableMonthCalendar1;
511
- private System.Windows.Forms.Button buttonDataGridView;
509
+ private System.Windows.Forms.Button buttonDataGridView;
510
+ private System.Windows.Forms.MonthCalendar automatableMonthCalendar1;
512
511
  }
513
512
  }
514
513
 
@@ -1,5 +1,6 @@
1
1
  using System;
2
2
  using System.Windows.Forms;
3
+ using UIA.Extensions;
3
4
 
4
5
  namespace WindowsForms
5
6
  {
@@ -8,6 +9,7 @@ namespace WindowsForms
8
9
  public MainFormWindow()
9
10
  {
10
11
  InitializeComponent();
12
+ automatableMonthCalendar1.AsValueControl<ValueMonthCalendar>();
11
13
  }
12
14
 
13
15
  private void label1_Click(object sender, EventArgs e)
@@ -0,0 +1,28 @@
1
+ using System;
2
+ using System.Globalization;
3
+ using System.Windows.Forms;
4
+ using UIA.Extensions.AutomationProviders.Interfaces;
5
+
6
+ namespace WindowsForms
7
+ {
8
+ public class ValueMonthCalendar : ValueControl
9
+ {
10
+ private readonly MonthCalendar _monthCalendar;
11
+
12
+ public ValueMonthCalendar(MonthCalendar monthCalendar) : base(monthCalendar)
13
+ {
14
+ _monthCalendar = monthCalendar;
15
+ }
16
+
17
+ public override string Value
18
+ {
19
+ get { return _monthCalendar.SelectionStart.ToString("d", EnglishCulture); }
20
+ set { _monthCalendar.SetDate(DateTime.Parse(value, EnglishCulture)); }
21
+ }
22
+
23
+ private static CultureInfo EnglishCulture
24
+ {
25
+ get { return new CultureInfo("en-US"); }
26
+ }
27
+ }
28
+ }