Пример #1
0
        private void addButton_Click(object sender, EventArgs e)
        {
            EditForm dialog = new EditForm(isAdmin);
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                if (dialog.AdminRights)
                    MachineRunKey.SetValue(dialog.ItemName, dialog.ItemLocation);
                else
                    UserRunKey.SetValue(dialog.ItemName, dialog.ItemLocation);

                CreateRow(dialog.ItemName, dialog.ItemLocation, dialog.AdminRights, false, true);
            }
        }
Пример #2
0
        private void editButton_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem item in listView.SelectedItems)
            {
                ItemTag tag = (ItemTag)item.Tag;
                if (tag.Wow)
                    break;
                EditForm dialog = new EditForm(isAdmin, tag.Name, tag.FilePath, tag.AdminRights);
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    item.SubItems[0].Text = dialog.ItemName;
                    item.SubItems[1].Text = dialog.ItemLocation;
                    if (dialog.AdminRights)
                    {
                        MachineRunKey.DeleteValue(tag.Name, false);
                        MachineRunKey.SetValue(dialog.ItemName, dialog.ItemLocation);
                        item.SubItems[2].Text = "All Users";
                    }
                    else
                    {
                        UserRunKey.DeleteValue(tag.Name, false);
                        UserRunKey.SetValue(dialog.ItemName, dialog.ItemLocation);
                        item.SubItems[2].Text = "Current User";
                    }

                    //if (wow) item.SubItems[3].Text = "Wow6432";

                    tag.Name = dialog.ItemName;
                    tag.FilePath = dialog.ItemLocation;
                    tag.AdminRights = dialog.AdminRights;
                    //tag.wow = wow;

                    item.Tag = tag;
                    item.Selected = true;
                }
            }
        }