예제 #1
0
        private void tss_setting_Click(object sender, EventArgs e)
        {
            SettingForm sf = new SettingForm();

            if (sf.ShowDialog() == DialogResult.OK)
            {
                if (MessageBox.Show("配置保存成功,需要重新启动才能生效,是否立即重启?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    Application.Restart();
                }
            }
        }
예제 #2
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);


            //判断是否生成配置文件
            string file = System.AppDomain.CurrentDomain.BaseDirectory + "application.ini";

            if (!File.Exists(file))
            {
                SettingForm settingForm = new SettingForm();
                settingForm.ShowDialog();
            }
            //Updater update = new Updater();
            //update.CheckUpdate();
            //获取默认的系统配置
            Global.sysConfig = ConfigureHelper.getInitConfigure();
            //判断是否指定参数
            if (args != null && args.Length > 0)
            {
                Global.sysConfig.WindowConfig.Url       = args[0];
                Global.sysConfig.WindowConfig.Viewmodel = args.Length > 1 ? args[1] : "";
            }
            else
            {
                Global.sysConfig.WindowConfig.Url       = Global.sysConfig.MainUrl;
                Global.sysConfig.WindowConfig.Viewmodel = Global.sysConfig.DefaultViewModel;
            }

            Global.sysConfig.WindowConfig.IsMainForm = true;

            /*
             * string setting = Global.sysConfig.GetSetting();
             * frmScBrowser main = new frmScBrowser(setting);
             * Global.formList.Add(main);
             * main.LoadUrl(Global.sysConfig.WindowConfig.Url, "IE11");
             * Application.Run(main);
             */
            Application.Run(new MainForm());
        }