Example #1
0
            private void AddNewItem()
            {
                using (var shellKey = RegistryEx.GetRegistryKey(ShellPath, true, true))
                {
                    string keyName = ItemText.Replace("\\", "").Trim();
                    NewItemRegPath = ObjectPath.GetNewPathWithIndex($@"{ShellPath}\{keyName}", ObjectPath.PathType.Registry);
                    keyName        = RegistryEx.GetKeyName(NewItemRegPath);

                    using (var key = shellKey.CreateSubKey(keyName, true))
                    {
                        key.SetValue("MUIVerb", ItemText);
                        if (rdoMulti.Checked)
                        {
                            key.SetValue("SubCommands", "");
                        }
                        else
                        {
                            if (!string.IsNullOrWhiteSpace(ItemCommand))
                            {
                                key.CreateSubKey("command", true).SetValue("", ItemCommand);
                            }
                        }
                    }
                }
            }
Example #2
0
 private void AddNewItem()
 {
     this.RegPath = $@"{IEList.IEPath}\{IEItem.MeParts[0]}\{ItemText.Replace("\\", "")}";
     Microsoft.Win32.Registry.SetValue(RegPath, "", ItemCommand);
 }