private void CreateShellItem(ShellCommonItem item) { if (!item.IsSelected) { return; } string regPath = ObjectPath.GetNewPathWithIndex ($@"{ShellPath}\{item.DefaultKeyName}", ObjectPath.PathType.Registry); ShellCommonItem.WriteSubKeysValue(item.ItemXE, regPath); SelectedShellPaths.Add(regPath); }
private void LoadShellItems() { foreach (XmlElement itemXE in shellXE.GetElementsByTagName("Item")) { XmlElement szXE = (XmlElement)itemXE.SelectSingleNode("Value/REG_SZ"); string keyName = itemXE.GetAttribute("KeyName"); if (string.IsNullOrWhiteSpace(keyName)) { continue; } ShellCommonItem item = new ShellCommonItem { DefaultKeyName = keyName, ItemXE = itemXE }; if (szXE != null) { item.Text = ResourceString.GetDirectString(szXE.GetAttribute("MUIVerb")); if (szXE.HasAttribute("Icon")) { item.Image = ResourceIcon.GetIcon(szXE.GetAttribute("Icon"))?.ToBitmap(); } else if (szXE.HasAttribute("HasLUAShield")) { item.Image = AppImage.Shield; } } if (item.Image == null) { item.Image = AppImage.NotFound; } if (string.IsNullOrWhiteSpace(item.Text)) { item.Text = item.DefaultKeyName; } item.SetTip(itemXE.GetAttribute("Tip")); list.AddItem(item); } }