using System;
using System.Threading;
using System.Windows.Forms;

namespace SepehrHotelApiSampleClient
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            //https://stackoverflow.com/a/21242188/7780428
            Application.ThreadException += HandleAll;
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());
        }

        private static void HandleAll(object sender, ThreadExceptionEventArgs e)
        {
            MessageBox.Show($@"خطا:{Environment.NewLine}{e.Exception.Message}");
        }
    }
}
