Пример #1
0
        private bool DeleteEntries()
        {
            bool success = true;

            foreach (ListViewItem item in lstResults.SelectedItems)
            {
                RegistryExplorer.Registry.RegSearchMatch match =
                    (RegistryExplorer.Registry.RegSearchMatch)item.Tag;

                // if value is not specified
                if (match.Value == "-")
                {
                    if (RegistryExplorer.Registry.RegUtility.DeleteKey(match.Key))
                    {
                        item.Remove();
                    }
                    else
                    {
                        success = false;
                    }
                }
                else
                if (RegistryExplorer.Registry.RegUtility.DeleteValue(match.Key, match.Value))
                {
                    item.Remove();
                }
                else
                {
                    success = false;
                }
            }
            return(success);
        }
Пример #2
0
        private void AddResultToListView(RegistryExplorer.Registry.RegSearchMatch result)
        {
            var item = lstResults.Items.Add(result.Key);

            item.Tag = result;
            item.SubItems.Add(RegistryExplorer.Registry.RegUtility.GetRegValueName(result.Value));
            item.SubItems.Add(result.Data);
        }
Пример #3
0
        private void lstResults_DoubleClick(object sender, System.EventArgs e)
        {
            if (lstResults.SelectedItems.Count == 1)
            {
                RegistryExplorer.Registry.RegSearchMatch match =
                    lstResults.SelectedItems[0].Tag as RegistryExplorer.Registry.RegSearchMatch;

                if (JumpToKey(match.Key))
                {
                    if (match.Value != "-")
                    {
                        string       valueName = RegistryExplorer.Registry.RegUtility.GetRegValueName(match.Value);
                        ListViewItem item      = lstValues.Items[valueName];
                        if (item != null)
                        {
                            item.Selected = true;
                            lstValues.Focus();
                        }
                    }
                }
            }
        }