Exemplo n.º 1
0
        public override void OnLoad()
        {
            thisProcess      = Process.GetCurrentProcess();
            thisWindowHandle = thisProcess.MainWindowHandle;
            timer            = new Timer(500);
            timer.Elapsed   += TimerElapsed;
            timer.Start();
            CheckCanSave();

            if (textBoxApplication.Text != null || textBoxWindowTitle.Text != null)
            {
                WindowFinder.Find(ActionInfo, hwnd =>
                {
                    CurrentlySelectedWindow = hwnd;
                });
            }
        }
Exemplo n.º 2
0
        public override void Perform()
        {
            int num = WindowFinder.Find(ActionInfo, hwnd =>
            {
                foreach (IWindowAction action in ActionInfo.WindowActions)
                {
                    action.Perform(hwnd);
                    Thread.Sleep(50);
                }
            }
                                        );

            // If we can't find the window, then num appears to be non-zero.
            if (num != 0)
            {
                ErrorLog.AddError(ErrorType.Failure, string.Format("The Window '{0}' is not avaliable", ActionInfo.WindowInfo.Title));
            }
        }