Sha256: 4da74105ac279699b429adec4e591dc07f385084a1a339b5922f972ad1ea8c32

Contents?: true

Size: 1.07 KB

Versions: 10

Compression:

Stored size: 1.07 KB

Contents

using System.Windows.Automation;
using RAutomation.UIA.Extensions;

namespace RAutomation.UIA.Controls
{
    public class Spinner
    {
        private readonly AutomationElement _element;

        public Spinner(AutomationElement element)
        {
            _element = element;
        }

        public double Value
        {
            get { return RangeValue.Current.Value; }
            set { RangeValue.SetValue(value); }
        }

        public double Minimum
        {
            get { return RangeValue.Current.Minimum; }
        }

        public double Maximum
        {
            get { return RangeValue.Current.Maximum; }
        }

        public double Increment()
        {
            return Value += RangeValue.Current.SmallChange;
        }

        public double Decrement()
        {
            return Value -= RangeValue.Current.SmallChange;
        }

        private RangeValuePattern RangeValue
        {
            get { return _element.As<RangeValuePattern>(RangeValuePattern.Pattern); }
        }
    }
}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rautomation-1.1.0 ext/UiaDll/RAutomation.UIA/Controls/Spinner.cs
rautomation-1.0.0 ext/UiaDll/RAutomation.UIA/Controls/Spinner.cs
rautomation-0.17.0 ext/UiaDll/RAutomation.UIA/Controls/Spinner.cs
rautomation-0.16.0 ext/UiaDll/RAutomation.UIA/Controls/Spinner.cs
rautomation-0.15.0 ext/UiaDll/RAutomation.UIA/Controls/Spinner.cs
rautomation-0.14.1 ext/UiaDll/RAutomation.UIA/Controls/Spinner.cs
rautomation-0.14.0 ext/UiaDll/RAutomation.UIA/Controls/Spinner.cs
rautomation-0.13.0 ext/UiaDll/RAutomation.UIA/Controls/Spinner.cs
rautomation-0.12.0 ext/UiaDll/RAutomation.UIA/Controls/Spinner.cs
rautomation-0.11.0 ext/UiaDll/RAutomation.UIA/Controls/Spinner.cs