using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using GatewayCommon;
using System.Threading;

namespace OsaGateway
{
    static class Program
    {
        public static GatewayControl gateway;

        public static List<string> NewSMSGuid = new List<string>();
        public static List<string> NewCallGuid = new List<string>();

        static public string Pin = string.Empty;

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Connect());
            if (gateway != null)
            {
                gateway.SetPin += new GatewayControl.PinRequestHandler(gateway_SetPin);
                Application.Run(new Main());
                gateway.Close();
            }
            NewSMSGuid = null;
            NewCallGuid = null;
        }

        static string gateway_SetPin()
        {
            Application.Run(new PinRequest());
            return Pin;
        }
    }
}
