/// <summary>
        /// Password input for encrypted xml config.
        /// </summary>
        public Password()
        {
            InitializeComponent();
            toolStripStatusLabel1.Text = "";
            fail = 1;
#if DEBUG
            toolStripStatusLabel1.Text = _language;
#endif
            //checkConfigPath();
            _confDir = Password_helper.CheckConfDir();
            FillLanguage();

            if (File.Exists(_confDir))
            {
                labelPassword_second.Visible   = false;
                textBoxPassword_second.Visible = false;
                labelOldPassword.Visible       = false;
                textBoxOldPassword.Visible     = false;
            }
            else
            {
                labelOldPassword.Visible   = false;
                textBoxOldPassword.Visible = false;
            }
        }
Exemple #2
0
        /// <summary>
        /// initialized the singelton.
        /// </summary>
        /// <param name="conf"></param>
        /// <returns></returns>
        public Config Init(Config conf)
        {
            string dirPath = string.Format(Application.StartupPath);

            conf.XmlPathName = Password_helper.CheckConfDir();

            conf.GroupName = null;

            if (!conf.HasEntry(ConfigTrm.Mainconfig.Section, ConfigTrm.Mainconfig.Type))
            {
                conf.SetValue(ConfigTrm.Mainconfig.Section, ConfigTrm.Mainconfig.Type, ConfigTrm.Mainconfig.Typename);
            }

            if (!conf.HasEntry(ConfigTrm.Mainconfig.Section, ConfigTrm.Mainconfig.Passwordtest))
            {
                conf.SetValue(ConfigTrm.Mainconfig.Section, ConfigTrm.Mainconfig.Passwordtest, "Waldmann");
            }

            if (!conf.HasEntry(ConfigTrm.Mainconfig.Section, ConfigTrm.Mainconfig.Defaultlanguage))
            {
                conf.SetValue(ConfigTrm.Mainconfig.Section, ConfigTrm.Mainconfig.Defaultlanguage, "E");
            }

            if (!conf.HasEntry(ConfigTrm.Mainconfig.Section, ConfigTrm.Mainconfig.Language))
            {
                conf.SetValue(ConfigTrm.Mainconfig.Section, ConfigTrm.Mainconfig.Language,
                              Application.StartupPath + "\\language.xml");
            }

            if (conf.GetValue(ConfigTrm.Mainconfig.Section, ConfigTrm.Mainconfig.Languagefile, "") !=
                Application.StartupPath + "\\language.xml")
            {
                conf.SetValue(ConfigTrm.Mainconfig.Section, ConfigTrm.Mainconfig.Languagefile,
                              Application.StartupPath + "\\language.xml");
            }

            return(conf);
        }