public TouchAction(JsonTouchAction jsonTouchAction, Automator automator)
        {
            _jsonTouchAction = jsonTouchAction;
            _automator = automator;

            if (this.Action == Wait)
            {
                this.MiliSeconds = jsonTouchAction.GetOptionAsInt("ms");
                return;
            }

            if (this.Action == Release)
            {
                return;
            }

            if (this.Action == Tap)
            {
                int count;
                this.Count = int.TryParse(jsonTouchAction.Options["count"], out count) ? count : 1;
            }

            if (this.Action == LongPress)
            {
                this.MiliSeconds = jsonTouchAction.Options.ContainsKey("duration")
                    ? jsonTouchAction.GetOptionAsInt("duration")
                    : 1000;
            }
        }
Exemple #2
0
        public TouchAction(JsonTouchAction jsonTouchAction, Automator automator)
        {
            _jsonTouchAction = jsonTouchAction;
            _automator       = automator;

            if (this.Action == Wait)
            {
                this.MiliSeconds = jsonTouchAction.GetOptionAsInt("ms");
                return;
            }

            if (this.Action == Release)
            {
                return;
            }

            if (this.Action == Tap)
            {
                int count;
                this.Count = int.TryParse(jsonTouchAction.Options["count"], out count) ? count : 1;
            }

            if (this.Action == LongPress)
            {
                this.MiliSeconds = jsonTouchAction.Options.ContainsKey("duration")
                    ? jsonTouchAction.GetOptionAsInt("duration")
                    : 1000;
            }
        }