public override bool Play(ESRPlayer player)
 {
     //Waiting
     player.WaitingPlaying(this);
     //Action
     return(true);
 }
        public override bool Play(ESRPlayer player)
        {
            //Waiting
            player.WaitingPlaying(this);
            //Action
            GM.Instance.InputSimulator.Mouse.VerticalScroll(this.MouseData);
            foreach (var item in this.ChildItems)
            {
                MouseWheelRecorderItem mouseItem = item as MouseWheelRecorderItem;
                if (mouseItem == null)
                {
                    continue;
                }

                if (!player.IsThreadEnable)
                {
                    return(false);
                }

                //Waiting
                player.WaitingPlaying(item);
                //Action
                GM.Instance.InputSimulator.Mouse.VerticalScroll(mouseItem.MouseData);
            }
            return(true);
        }
Example #3
0
        public override bool Play(ESRPlayer player)
        {
            //Waiting
            player.WaitingPlaying(this);

            //Action
            if (this.Dir == Dir.Up)
            {
                GM.Instance.InputSimulator.Keyboard.KeyUp((VirtualKeyCode)this.VkCode);
            }
            else if (this.Dir == Dir.Down)
            {
                GM.Instance.InputSimulator.Keyboard.KeyDown((VirtualKeyCode)this.VkCode);
            }
            return(true);
        }
        public override bool Play(ESRPlayer player)
        {
            //Waiting
            player.WaitingPlaying(this);
            foreach (var item in this.ChildItems)
            {
                if (!player.IsThreadEnable)
                {
                    return(false);
                }

                //Waiting
                player.WaitingPlaying(item);
            }
            return(true);
        }
        public override bool Play(ESRPlayer player)
        {
            //Waiting
            player.WaitingPlaying(this);

            //Action
            Point pt = AUtil.ToMouseSimulatorPoint(this.Point);

            GM.Instance.InputSimulator.Mouse.MoveMouseTo(pt.X, pt.Y);
            if (this.Button == ButtonType.Left)
            {
                GM.Instance.InputSimulator.Mouse.LeftButtonClick();
            }
            else
            {
                GM.Instance.InputSimulator.Mouse.RightButtonClick();
            }

            foreach (var item in this.ChildItems)
            {
                MouseClickRecorderItem mouseItem = item as MouseClickRecorderItem;
                if (mouseItem == null)
                {
                    continue;
                }

                if (!player.IsThreadEnable)
                {
                    return(false);
                }

                //Waiting
                player.WaitingPlaying(item);
                //Action
                if (this.Button == ButtonType.Left)
                {
                    GM.Instance.InputSimulator.Mouse.LeftButtonClick();
                }
                else
                {
                    GM.Instance.InputSimulator.Mouse.RightButtonClick();
                }
            }

            return(true);
        }
        public override bool Play(ESRPlayer player)
        {
            //Waiting
            player.WaitingPlaying(this);

            //Action
            Point pt = AUtil.ToMouseSimulatorPoint(this.Point);

            GM.Instance.InputSimulator.Mouse.MoveMouseTo(pt.X, pt.Y);

            if (this.Dir == Dir.Down)
            {
                if (this.Button == ButtonType.Left)
                {
                    GM.Instance.InputSimulator.Mouse.LeftButtonDown();
                }
                else if (this.Button == ButtonType.Right)
                {
                    GM.Instance.InputSimulator.Mouse.RightButtonDown();
                }
                else if (this.Button == ButtonType.Wheel)
                {
                    GM.Instance.InputSimulator.Mouse.MiddleButtonDown();
                }
            }
            else
            {
                if (this.Button == ButtonType.Left)
                {
                    GM.Instance.InputSimulator.Mouse.LeftButtonUp();
                }
                else if (this.Button == ButtonType.Right)
                {
                    GM.Instance.InputSimulator.Mouse.RightButtonUp();
                }
                else if (this.Button == ButtonType.Wheel)
                {
                    GM.Instance.InputSimulator.Mouse.MiddleButtonUp();
                }
            }
            return(true);
        }
        public override bool Play(ESRPlayer player)
        {
            //Waiting
            player.WaitingPlaying(this);

            //Action
            ActionVkCode(this);
            foreach (var i in this.ChildItems)
            {
                if (!player.IsThreadEnable)
                {
                    return(false);
                }

                KeyPressRecorderItem item = i as KeyPressRecorderItem;
                //Waiting
                player.WaitingPlaying(item);
                //Action
                ActionVkCode(item);
            }
            return(true);
        }
        public override bool Play(ESRPlayer player)
        {
            //Waiting
            player.WaitingPlaying(this);
            //Action
            Point pt = AUtil.ToMouseSimulatorPoint(this.Point);

            GM.Instance.InputSimulator.Mouse.MoveMouseTo(pt.X, pt.Y);
            foreach (var item in this.ChildItems)
            {
                if (!player.IsThreadEnable)
                {
                    return(false);
                }

                //Waiting
                player.WaitingPlaying(item);
                //Action
                pt = AUtil.ToMouseSimulatorPoint(item.Point);
                GM.Instance.InputSimulator.Mouse.MoveMouseTo(pt.X, pt.Y);
            }
            return(true);
        }
Example #9
0
        public ESRRecorder()
        {
            this.MouseRecorder       = new ESRMouseRecorder(this);
            this.KeyRecorder         = new ESRKeyRecorder(this);
            this.WaitingRecorder     = new ESRWaitingRecorder(this);
            this.ApplicationRecorder = new ESRApplicationRecorder(this);
            this.Player = new ESRPlayer(this);
            this.RecorderItemConfigManager = new ESRRecorderItemConfigManager(this);

            this.RecorderItemConfigManager.OnReplaceItem += (oldItem, newItem) =>
            {
                double totalTimeSpanSec = newItem.TotalTimeDurationSec - oldItem.TotalTimeDurationSec;
                ReplaceItem(oldItem, newItem);
                TimeSpan decreaseTime = TimeSpan.FromSeconds(totalTimeSpanSec);
                //Adjust a timestamp in remained items
                AdjustTimeSpanbyItem(newItem, decreaseTime);
            };

            this.RecorderItemConfigManager.OnUpdateItem += (item) =>
            {
                UpdateItem(item);
            };
        }
Example #10
0
 public abstract bool Play(ESRPlayer player);
 public override bool Play(ESRPlayer player)
 {
     return(true);
 }