예제 #1
0
        /// <summary>
        /// アプリケーションを終了します。
        /// </summary>
        public void EndProcess()
        {
            if (this.detector != null)
            {
                this.detector.Finish();
                this.detector = null;

                dynamic provider = this.app.Type("WinCap.Serialization.LocalSettingsProvider");
                provider.Instance.Reset();
                provider.Instance.Save();

                this.Shutdown();
            }
        }
예제 #2
0
        /// <summary>
        /// アプリケーションをアタッチします。
        /// </summary>
        public void Attach()
        {
            if (this.Process == null)
            {
                this.Process    = Process.Start(ExecutablePath, "-UITest");
                this.app        = new WindowsAppFriend(this.Process);
                this.mainWindow = new WindowControl(this.app.Type <Application>().Current.MainWindow);

                // アプリケーション設定をリセットする
                dynamic provider = this.app.Type("WinCap.Serialization.LocalSettingsProvider");
                provider.Instance.Reset();
            }
            this.detector           = new TimeoutDetector(1000 * 60 * 5);
            this.detector.Timedout += (sender, e) =>
            {
                this.Shutdown();
            };
            this.InitApp();
        }