示例#1
0
        public void showPathDialog(bool exitOnCancel)
        {
            string path = "";

            try
            {
                path = settings.GetStringArray("Hud Paths")[0];
            }
            catch { }

            var dialog = new SelectHudPathForm(settings.GetBool("Use Installed Hud"), settings.GetString("Custom Path"), path);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                if (dialog.UseCustomFolder)
                {
                    settings.Set("Use Installed Hud", true);
                    settings.Set("Custom Path", dialog.CustomPath);
                }
                else
                {
                    settings.Set("Use Installed Hud", false);
                    settings.Set("Hud Paths", dialog.HudPath);
                }
            }
            else
            {
                if (exitOnCancel)
                {
                    Environment.Exit(0);
                }
            }
        }
示例#2
0
文件: Form1.cs 项目: Knightshade/4Hud
        public void showPathDialog(bool exitOnCancel)
        {
            string path = "";
            try
            {
                path = settings.GetStringArray("Hud Paths")[0];
            }
            catch { }

            var dialog = new SelectHudPathForm(settings.GetBool("Use Installed Hud"), settings.GetString("Custom Path"),  path);
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                if (dialog.UseCustomFolder)
                {
                    settings.Set("Use Installed Hud", true);
                    settings.Set("Custom Path", dialog.CustomPath);
                }
                else
                {
                    settings.Set("Use Installed Hud", false);
                    settings.Set("Hud Paths", dialog.HudPath);
                }
            }
            else
            {
                if (exitOnCancel)
                    Environment.Exit(0);
            }
        }