Beispiel #1
0
        /// <summary>
        /// 注册客户端应用程序。
        /// 在 WPF Application 类的构造函数中调用此法。
        /// </summary>
        /// <param name="wpfClientApp"></param>
        public static ClientApp Register(IClientAppRuntime wpfClientApp)
        {
            var app = new ClientApp();

            app.AttachTo(wpfClientApp);
            return(app);
        }
Beispiel #2
0
        /// <summary>
        /// 注册客户端应用程序。
        /// 在 WPF Application 类的构造函数中调用此法。
        /// </summary>
        /// <param name="wpfApp"></param>
        public void AttachTo(IClientAppRuntime wpfApp)
        {
            if (wpfApp == null)
            {
                throw new ArgumentNullException("wpfApp");
            }

            wpfApp.Startup += (s, e) => this.Startup();
            wpfApp.Exit    += (s, e) => this.ExitApp();

            this._wpfApp = wpfApp;
        }
Beispiel #3
0
        private void AttachTo(IClientAppRuntime wpfApp)
        {
            if (wpfApp == null) throw new ArgumentNullException("wpfApp");

            wpfApp.Startup += (s, e) => this.Startup();
            wpfApp.Exit += (s, e) => this.ExitApp();

            this._wpfApp = wpfApp;
        }
Beispiel #4
0
 /// <summary>
 /// 注册客户端应用程序。
 /// 在 WPF Application 类的构造函数中调用此法。
 /// </summary>
 /// <param name="wpfClientApp"></param>
 public static ClientApp Register(IClientAppRuntime wpfClientApp)
 {
     var app = new ClientApp();
     app.AttachTo(wpfClientApp);
     return app;
 }