Exemplo n.º 1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            // Initialize Settings from Web.config
            Settings = new Settings(
                onTimeUrl: ConfigurationManager.AppSettings.Get("OnTimeUrl"),
                clientId: ConfigurationManager.AppSettings.Get("ClientId"),
                clientSecret: ConfigurationManager.AppSettings.Get("ClientSecret")
            );
        }
Exemplo n.º 2
0
        static void Main()
        {
            // Initialize Settings from App.config
            Settings = new Settings(
                onTimeUrl: ConfigurationManager.AppSettings.Get("OnTimeUrl"),
                clientId: ConfigurationManager.AppSettings.Get("ClientId"),
                clientSecret: ConfigurationManager.AppSettings.Get("ClientSecret")
            );

            // Set up exception handling
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            // set up SSL certificate warning callback
            System.Net.ServicePointManager.ServerCertificateValidationCallback = ServerCertificateValidation;

            // set up and start form
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new ApiForm());
        }
Exemplo n.º 3
0
        static void Main()
        {
            // Initialize Settings from App.config
            Settings = new Settings(
                onTimeUrl: ConfigurationManager.AppSettings.Get("OnTimeUrl"),
                clientId: ConfigurationManager.AppSettings.Get("ClientId"),
                clientSecret: ConfigurationManager.AppSettings.Get("ClientSecret")
            );

            // Set up exception handling
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            // set up SSL certificate warning callback
            System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate
            {
                return (MessageBox.Show("There is a problem with the server's SSL certificate.  Do you want to ignore the SSL errors?", "SSL certificate error", MessageBoxButtons.YesNo) == DialogResult.Yes);
            };

            // set up and start form
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new ApiForm());
        }