InitStringResouce() public static method

public static InitStringResouce ( string lang ) : void
lang string
return void
コード例 #1
0
        private void combox_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (combox.SelectedIndex >= 0)
                {
                    string lang = getLangFromString(combox.Text);

                    if (lang != null)
                    {
                        try {
                            Language.InitFormLanguage(frm, lang);
                            Language.InitStringResouce(lang);
                        }
                        catch {
                            // if error,do not alter setting
                            return;
                        }

                        StringResources.SetValue("lang", lang);
                        Language.WriteDefaultLanguage(lang);
                    }
                }
            }
            catch { }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: zeroaq/LabelPlus
        static void Main()
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");

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

            StringResources.SetValue("lang", Language.ReadDefaultLanguage());
            Language.InitStringResouce(StringResources.GetValue("lang"));

            //try{
            //    loadPsScript("ps_blank_layer");
            //    loadPsScript("ps_close_file");
            //    loadPsScript("ps_file_footer");
            //    loadPsScript("ps_file_header");
            //    loadPsScript("ps_header");
            //    loadPsScript("ps_labelnum");
            //    loadPsScript("ps_labeltext");
            //    loadPsScript("ps_add_group");
            //    loadPsScript("ps_run_action");
            //    loadPsScript("ps_del_group_sign");
            //}
            //catch(Exception e)
            //{
            //    MessageBox.Show("PS_Script Definition Error. \r\n"+ e.ToString());
            //    Environment.Exit(1);
            //}


            try{
                GlobalVar.Reload();
            }
            catch (Exception e) {
                MessageBox.Show("Read \"labelplus_config.xml\" Error! \r\n" + e.ToString());
                Environment.Exit(1);
            }

            Application.Run(new MainFrm());
        }