Exemplo n.º 1
0
            /// <summary>
            /// Runs the application
            /// </summary>
            public int Run(IAsynchronousHostableProgram programToHost)
            {
                try
                {
                    programToHost.ExitRequested += programToHost_ExitRequested;

                    Task programStart = programToHost.StartAsync();
                    HandleExceptions(programStart);

                    return(m_wpfApplication.Run());
                }
                finally
                {
                    //it is good practice to unsubscribe from events on objects that have longer lifetimes than the event handler
                    programToHost.ExitRequested -= programToHost_ExitRequested;
                }
            }
Exemplo n.º 2
0
			/// <summary>
			/// Runs the application
			/// </summary>
			public int Run(IAsynchronousHostableProgram programToHost)
			{
				try
				{
					programToHost.ExitRequested += programToHost_ExitRequested;

					Task programStart = programToHost.StartAsync();
					HandleExceptions(programStart);

					return m_wpfApplication.Run();
				}
				finally
				{
					//it is good practice to unsubscribe from events on objects that have longer lifetimes than the event handler
					programToHost.ExitRequested -= programToHost_ExitRequested;
				}
			}