Пример #1
0
 private static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     if (!IsConnected())
         using (var f = new DBLogonUI())
             f.ShowDialog();
     else
         Application.Run(new TouchUI());
 }
Пример #2
0
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (!CekConnection())
            {
                using (var f = new DBLogonUI())
                {
                    f.ShowDialog();
                }
            }
            else
            {
                Application.Run(new MainUI());
            }
        }
Пример #3
0
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            bool isConnected = false;
            int nCount = 0;

            // show Waiting
            using (var fsplash = new QWaitingWidget("Version " +
                Application.ProductVersion + "\r\n\r\n" +
                "Preparing application\r\nPlease wait!"))
            {
                fsplash.WindowState = FormWindowState.Maximized;
                fsplash.Show();
                fsplash.SetBigCircle();
                Application.DoEvents();

                // 5 phase before setting);
                while (!isConnected && nCount < 3)
                {
                    // connecting
                    isConnected = IsConnected(false);
                    nCount++;

                    if (!isConnected)
                    {
                        // set splash message
                        fsplash.SetMessage(
                            string.Format("Connection failed! Re-trying connecting to server\r\nPHASE {0}", nCount));
                        Application.DoEvents();

                        // delay
                        for (int i = 0; i <= 250; i++)
                        {
                            Thread.Sleep(10);
                            Application.DoEvents();
                        }
                    }
                    else
                    {
                        fsplash.SetMessage(string.Format("Connection successfully !"));
                        Application.DoEvents();
                        Thread.Sleep(250);
                    }
                }
            }

            // if still not connected, show db configuration
            if (!isConnected)
                using (var f = new DBLogonUI())
                    f.ShowDialog();
            else // in connected show main screen
                Application.Run(new MainScreen());
        }
Пример #4
0
 /// <summary>
 /// Ts the keymap.
 /// </summary>
 private void TDatabase()
 {
     if (InvokeRequired)
     {
         var o = new DelegateThis(TDatabase);
         Invoke(o);
     }
     else
     {
         var f = new DBLogonUI {MdiParent = this};
         f.Show();
     }
 }