示例#1
0
文件: winrunr.cs 项目: Jack54s/winrun
        private void btnAdd_Click(object sender, EventArgs e)
        {
            dlgSet dlg = new dlgSet();

            if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
            {
                regApp = regApps.CreateSubKey(dlg.kv.key);
                regApp.SetValue(null, dlg.kv.value);
                kvs.Add(dlg.kv);
                showItem(kvs.Last());
            }
        }
示例#2
0
文件: winrunr.cs 项目: Jack54s/winrun
        private void mnuAppEdit_Click(object sender, EventArgs e)
        {
            int    id  = lvwApps.SelectedItems[0].Index;
            dlgSet dlg = new dlgSet(id, kvs[id]);

            if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
            {
                if (dlg.kv.localMachine)
                {
                    regApp = regAppsEx.CreateSubKey(dlg.kv.key, RegistryKeyPermissionCheck.ReadWriteSubTree);
                }
                else
                {
                    regApp = regApps.CreateSubKey(dlg.kv.key);
                }
                regApp.SetValue(null, dlg.kv.value);
                kvs[id] = dlg.kv;
                showItem(kvs[id], id);
            }
        }