Esempio n. 1
0
        private void btnApply_Click(object sender, EventArgs e)
        {
            int nsel = cbEncConfig.SelectedIndex;

            if (nsel == -1)
            {
                return;
            }
            envCfgs.SetCurEnvConfig(nsel);
            envCfgs.SaveConfig();

            ThkEnvConfig enc = envCfgs.GetCurEnvConfig();

            if (enc != null)
            {
                ThkEnvCfgItem[] encitems = enc.EnvConfigItems;
                foreach (ThkEnvCfgItem ci in encitems)
                {
                    if (ci.EnvCfgFlatform == null || ci.EnvCfgFlatform.Length == 0 || ci.EnvCfgFlatform == "全部" || ci.EnvCfgFlatform == "")
                    {
                        Environment.SetEnvironmentVariable(ci.EnvCfgItem, ci.EnvCfgValue, EnvironmentVariableTarget.Process);
                    }
                }
            }
            DialogResult = DialogResult.OK;
            Close();
        }
Esempio n. 2
0
        private void btnBrowDir_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog fbd = new FolderBrowserDialog();
            DialogResult        dr  = fbd.ShowDialog();

            if (dr == DialogResult.OK)
            {
                cbProeDir.Text = fbd.SelectedPath;
                ThkProeDirCfgs proecfgs = m_envcfgs.GetProeDirs();
                if (proecfgs.AddProeDirs(fbd.SelectedPath))
                {
                    m_envcfgs.SaveConfig();
                }
            }
        }