Exemplo n.º 1
0
        private void btnIncludeDelete_Click(object sender, EventArgs e)
        {
            if (this.listView2.SelectedItems != null && this.listView2.SelectedItems.Count > 0)
            {
                var lvi = this.listView2.SelectedItems[0];
                if (lvi != null)
                {
                    var rule = lvi.Tag as RegistryKeyValue;

                    if (rule != null)
                    {
                        var dialogResult = MessageBox.Show(
                            this,
                            "Are you sure you want to delete this value?",
                            "Delete value",
                            MessageBoxButtons.YesNo,
                            MessageBoxIcon.Exclamation,
                            MessageBoxDefaultButton.Button2);

                        if (dialogResult == DialogResult.Yes)
                        {
                            this.collection.Remove(rule.Name);
                            this.listView2.Items.Remove(lvi);
                        }
                    }
                    else
                    {
                        this.listView2.Items.Remove(lvi);
                    }

                    this.Items = this.Items;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new instance of the <see cref="DependencyDecompiler"/> class.
        /// </summary>
        public DependencyDecompiler()
        {
            this.registryValues = new RegistryKeyValueCollection();
            this.keyCache       = new Dictionary <string, string>();

            this.TableDefinitions = DependencyExtensionData.GetExtensionTableDefinitions();
        }
Exemplo n.º 3
0
        private void btnIncludeDelete_Click(object sender, EventArgs e)
        {
            if (this.listView2.SelectedItems != null && this.listView2.SelectedItems.Count > 0)
            {
                var lvi = this.listView2.SelectedItems[0];
                if (lvi != null)
                {
                    var rule = lvi.Tag as RegistryKeyValue;

                    if (rule != null)
                    {
                        var dialogResult = MessageBox.Show(
                            this,
                            "Are you sure you want to delete this value?",
                            "Delete value",
                            MessageBoxButtons.YesNo,
                            MessageBoxIcon.Exclamation,
                            MessageBoxDefaultButton.Button2);

                        if (dialogResult == DialogResult.Yes)
                        {
                            this.collection.Remove(rule.Name);
                            this.listView2.Items.Remove(lvi);
                        }
                    }
                    else
                    {
                        this.listView2.Items.Remove(lvi);
                    }

                    this.Items = this.Items;
                }
            }
        }
Exemplo n.º 4
0
        private void Add(RegistryKeyValue rule)
        {
            this.collection.Add(rule);

            this.Items = this.Items;
        }
Exemplo n.º 5
0
        public RegistryKeyValueListControl()
        {
            this.InitializeComponent();

            this.collection = new RegistryKeyValueCollection();
        }
Exemplo n.º 6
0
 /// <summary>
 /// Creates a new instance of the <see cref="DependencyDecompiler"/> class.
 /// </summary>
 public DependencyDecompiler()
 {
     this.registryValues = new RegistryKeyValueCollection();
     this.keyCache       = new Dictionary <string, string>();
 }
Exemplo n.º 7
0
        public RegistryKeyValueListControl()
        {
            this.InitializeComponent();

            this.collection = new RegistryKeyValueCollection();
        }
Exemplo n.º 8
0
        private void Add(RegistryKeyValue rule)
        {
            this.collection.Add(rule);

            this.Items = this.Items;
        }
Exemplo n.º 9
0
        /// <summary>
        /// Adds a registry key value to the specified key value collection.
        /// </summary>
        /// <param name="collection">The collection which the value should be added.</param>
        /// <param name="value">The registry key value.</param>
        private static void AddValue(RegistryKeyValueCollection collection, RegistryKeyValue value)
        {
            if (collection == null)
            {
                throw new ArgumentNullException("collection");
            }

            if (value == null)
            {
                throw new ArgumentNullException("value");
            }

            if (string.IsNullOrEmpty(value.Name))
            {
                throw new InvalidOperationException("One of the registry key values had no name specified.");
            }
            else if (collection.ContainsKey(value.Name))
            {
                throw new InvalidOperationException("One of the registry key value names occured more than once for the same key: " + value.Name);
            }
            else
            {
                collection.Add(value.Name, value);
            }
        }