[go: nahoru, domu]

Skip to content

Commit

Permalink
Fixed SetValue and GetValue (use LegacyIAccessiblePattern instead of …
Browse files Browse the repository at this point in the history
…RangeValuePattern)
  • Loading branch information
Tieho committed Sep 18, 2016
1 parent 2a6a29b commit f9f2394
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Ldtpd/Value.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Cobra WinLDTP 4.0
*
* Author: Nagappan Alagappan <nalagappan@vmware.com>
Expand Down Expand Up @@ -76,15 +76,17 @@ private void LogMessage(Object o)
"Object state is disabled");
}
childHandle.SetFocus();
if (childHandle.TryGetCurrentPattern(RangeValuePattern.Pattern,
if (childHandle.TryGetCurrentPattern(LegacyIAccessiblePattern.Pattern,
out pattern))
{
if (((RangeValuePattern)pattern).Current.IsReadOnly)
/*
if (((LegacyIAccessiblePattern)pattern).Current.IsReadOnly)
{
throw new XmlRpcFaultException(123,
"Control is read-only.");
}
((RangeValuePattern)pattern).SetValue(value);
*/
((LegacyIAccessiblePattern)pattern).SetValue(Convert.ToString(value, CultureInfo.InvariantCulture));
return 1;
}
}
Expand Down Expand Up @@ -112,15 +114,17 @@ public double GetValue(String windowName, String objName)
try
{
childHandle.SetFocus();
if (childHandle.TryGetCurrentPattern(RangeValuePattern.Pattern,
if (childHandle.TryGetCurrentPattern(LegacyIAccessiblePattern.Pattern,
out pattern))
{
if (((RangeValuePattern)pattern).Current.IsReadOnly)
/*
if (((LegacyIAccessiblePattern)pattern).Current.IsReadOnly)
{
throw new XmlRpcFaultException(123,
"Control is read-only.");
}
return ((RangeValuePattern)pattern).Current.Value;
*/
return Convert.ToDouble(((LegacyIAccessiblePattern)pattern).Current.Value, CultureInfo.InvariantCulture);
}
}
catch (Exception ex)
Expand Down

0 comments on commit f9f2394

Please sign in to comment.