Example #1
0
        /// <summary>
        /// Init Event
        /// </summary>
        private void Window_Initialized(object sender, EventArgs e)
        {
            //Setting Position
            this.WindowStartupLocation = WindowStartupLocation.Manual;
            System.Drawing.Rectangle screen = System.Windows.Forms.SystemInformation.VirtualScreen;
            this.Left = Convert.ToInt32(screen.Right - this.Width - 10);
            this.Top  = Convert.ToInt32(screen.Bottom - this.Height - 35);
            this.ShowDialog();

            //Network Check
            NetworkMgr   nMgr  = new NetworkMgr();
            NInformation nInfo = nMgr.GetNetworkInformation();

            if (!nInfo.IsConnected)
            {
                MessageBox.Show("인터넷 연결을 확인하십시오.");
                Process.GetCurrentProcess().Kill();
            }

            // SOME STUFF HERE
        }
Example #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            NetworkMgr   nMgr  = new NetworkMgr();
            NInformation nInfo = new NInformation();

            nInfo = nMgr.GetNetworkInformation();
            if (nInfo.IsConnected == true)
            {
                //Loading Window Close
                this.Hide();

                RegisteryMgr rMgr = new RegisteryMgr();
                try
                {
                    Object res = rMgr.getUserRegisteryValue("CheerUp", "AutoLogin");
                    if (((string)res).Equals("true"))
                    {
                        bool result_login = login((string)rMgr.getUserRegisteryValue("CheerUp", "LID"), (string)rMgr.getUserRegisteryValue("CheerUp", "LALP"));
                        if (result_login)
                        {
                            MainWindow mWindow = new MainWindow();
                            mWindow.ShowDialog();
                            this.Close();
                        }
                        else
                        {
                            LoginWindow lWindow = new LoginWindow();
                            lWindow.WindowStartupLocation = WindowStartupLocation.Manual;
                            System.Drawing.Rectangle screen = System.Windows.Forms.SystemInformation.VirtualScreen;
                            lWindow.Left = Convert.ToInt32(screen.Right - lWindow.Width - 10);
                            lWindow.Top  = Convert.ToInt32(screen.Bottom - lWindow.Height - 50);
                            lWindow.ShowDialog();
                        }
                    }
                    else
                    {
                        LoginWindow lWindow = new LoginWindow();
                        lWindow.WindowStartupLocation = WindowStartupLocation.Manual;
                        System.Drawing.Rectangle screen = System.Windows.Forms.SystemInformation.VirtualScreen;
                        lWindow.Left = Convert.ToInt32(screen.Right - lWindow.Width - 10);
                        lWindow.Top  = Convert.ToInt32(screen.Bottom - lWindow.Height - 50);
                        lWindow.ShowDialog();
                    }
                }
                catch (Exception)
                {
                    LoginWindow lWindow = new LoginWindow();
                    lWindow.WindowStartupLocation = WindowStartupLocation.Manual;
                    System.Drawing.Rectangle screen = System.Windows.Forms.SystemInformation.VirtualScreen;
                    lWindow.Left = Convert.ToInt32(screen.Right - lWindow.Width - 10);
                    lWindow.Top  = Convert.ToInt32(screen.Bottom - lWindow.Height - 50);
                    lWindow.ShowDialog();
                }
            }
            else
            {
                MessageBox.Show("인터넷 연결을 확인하십시오.");
                Process.GetCurrentProcess().Kill();
            }
            this.Close();
        }