예제 #1
0
        private void loadAliases()
        {
            var            config    = ConfigurationManager.AppSettings;
            BDEAliasesFile aliasFile = new BDEAliasesFile(config.Get("bdeAliasesFile"));

            aliases = aliasFile.GetAliases();
            aliasList.Items.Clear();
            foreach (var alias in aliases)
            {
                aliasList.Items.Add(alias.name);
            }
        }
예제 #2
0
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var            config    = ConfigurationManager.AppSettings;
            BDEAliasesFile aliasFile = new BDEAliasesFile(config.Get("bdeAliasesFile"));
            string         name      = nameTextBox.Text;
            string         path      = pathTextBox.Text;
            bool           enableBCD = enableBCDCheckBox.Checked;

            if (aliasList.SelectedIndex > -1)
            {
                aliasFile.UpdateAlias(currentName, currentPath, name, path, enableBCD);
            }
            else
            {
                aliasFile.CreateNewAlias(name, path, enableBCD);
            }

            loadAliases();
        }