Exemplo n.º 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);
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
 }