コード例 #1
0
        private static void Main()
        {
            LogService.init();
            RConfig.Instance.load();
            Localizate.load();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            SplashForm.Instance.Show();

            //Thread.Sleep(2000);

            _log.Info("Program started");

            MessageBox.parentForm = MainForm.Instance;

            SplashForm.Instance.Close();
            try
            {
                Application.Run(MainForm.Instance);
                _log.Info("Quit program");
            }
            catch (Exception e)
            {
                _log.Info("Exception: Program.Main(): " + e, e);
            }
        }
コード例 #2
0
        private void OkBtn_Click(object sender, EventArgs e)
        {
            RConfig.Instance.save();

            Localizate.load();

            Close();
        }
コード例 #3
0
        private void FastL2INIOptionForm_Load(object sender, EventArgs e)
        {
            Localizate.load();
            try
            {
                BinaryReader f = L2EncDec.Decrypt("l2.ini", Encoding.Default);
                if (f == null)
                {
                    return;
                }
                char[] IniText = f.ReadChars((int)f.BaseStream.Length);
                f.Close();
                L2Edit.Text = new String(IniText);


                for (int i = 0; i < L2Edit.Lines.Length; i++)
                {
                    if (L2Edit.Lines[i].StartsWith("ServerAddr="))
                    {
                        String   s  = L2Edit.Lines[i];
                        char     p  = '=';
                        String[] ss = s.Split(p);
                        HostText.Text = ss[1];
                    }
                    if (L2Edit.Lines[i].StartsWith("Port="))
                    {
                        String   s  = L2Edit.Lines[i];
                        char     p  = '=';
                        String[] ss = s.Split(p);
                        PortText.Text = ss[1];
                    }
                    if (L2Edit.Lines[i].StartsWith("IsL2NetLog="))
                    {
                        String   s  = L2Edit.Lines[i];
                        char     p  = '=';
                        String[] ss = s.Split(p);
                        NetLog.Checked = Boolean.Parse(ss[1]);
                    }
                    if (L2Edit.Lines[i].StartsWith("L2TestServer="))
                    {
                        String   s  = L2Edit.Lines[i];
                        char     p  = '=';
                        String[] ss = s.Split(p);
                        TestServer.Checked = Boolean.Parse(ss[1]);
                    }
                    if (L2Edit.Lines[i].StartsWith("EnableSecondWindow="))
                    {
                        String   s  = L2Edit.Lines[i];
                        char     p  = '=';
                        String[] ss = s.Split(p);
                        SeccondWind.Checked = Boolean.Parse(ss[1]);
                    }
                }

                // локализация
                Text             = Localizate.getMessage(Word.MENU_SERVICE_FAST_SETTINGS) + " : " + "l2.ini";
                InetGrop.Text    = Localizate.getMessage(Word.INTERNET_GROUP);
                OtherGroup.Text  = Localizate.getMessage(Word.OTHER_GROUP);
                SeccondWind.Text = Localizate.getMessage(Word.SECOND_CLIENT);
                TestServer.Text  = Localizate.getMessage(Word.TEST_SERVER);
                NetLog.Text      = Localizate.getMessage(Word.NETWORK_LOG);
                Host.Text        = Localizate.getMessage(Word.HOST);
                Port.Text        = Localizate.getMessage(Word.PORT);
                REfBtn.Text      = Localizate.getMessage(Word.REFRESH);
                SaveBtn.Text     = Localizate.getMessage(Word.SAVE_BUTTON);
            }
            catch (Exception ex)
            {
                _log.Info("Exception: " + ex, ex);
            }
        }