private void LoadShellItems(XmlElement shellXE, GroupPathItem groupItem)
 {
     foreach (XmlElement itemXE in shellXE.GetElementsByTagName("Item"))
     {
         XmlElement verXE = (XmlElement)itemXE.SelectSingleNode("OSVersion");
         if (!JudgeOSVersion(verXE))
         {
             continue;
         }
         XmlElement szXE    = (XmlElement)itemXE.SelectSingleNode("Value/REG_SZ");
         string     keyName = itemXE.GetAttribute("KeyName");
         if (keyName.IsNullOrWhiteSpace())
         {
             continue;
         }
         string           regPath = $@"{groupItem.TargetPath}\shell\{keyName}";
         EnhanceShellItem item    = new EnhanceShellItem()
         {
             RegPath       = $@"{groupItem.TargetPath}\shell\{keyName}",
             FoldGroupItem = groupItem,
             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 (item.Text.IsNullOrWhiteSpace())
         {
             item.Text = keyName;
         }
         item.ChkVisible.Checked = item.ItemVisible;
         MyToolTip.SetToolTip(item.ChkVisible, itemXE.GetAttribute("Tip"));
         this.AddItem(item);
     }
 }
 private void LoadShellItems(XmlElement shellXE, GroupPathItem groupItem)
 {
     foreach (XmlElement itemXE in shellXE.SelectNodes("Item"))
     {
         if (!JudgeOSVersion(itemXE))
         {
             continue;
         }
         if (!FileExists(itemXE))
         {
             continue;
         }
         XmlElement szXE    = (XmlElement)itemXE.SelectSingleNode("Value/REG_SZ");
         string     keyName = itemXE.GetAttribute("KeyName");
         if (keyName.IsNullOrWhiteSpace())
         {
             continue;
         }
         EnhanceShellItem item = new EnhanceShellItem()
         {
             RegPath       = $@"{groupItem.TargetPath}\shell\{keyName}",
             FoldGroupItem = groupItem,
             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;
             }
             else
             {
                 XmlElement cmdXE = (XmlElement)itemXE.SelectSingleNode("SubKey/Command");
                 if (cmdXE != null)
                 {
                     Icon icon = null;
                     if (cmdXE.HasAttribute("Default"))
                     {
                         string filePath = ObjectPath.ExtractFilePath(cmdXE.GetAttribute("Default"));
                         icon = ResourceIcon.GetIcon(filePath);
                     }
                     item.Image = icon?.ToBitmap();
                     icon?.Dispose();
                 }
             }
         }
         if (item.Image == null)
         {
             item.Image = AppImage.NotFound;
         }
         if (item.Text.IsNullOrWhiteSpace())
         {
             item.Text = keyName;
         }
         item.ChkVisible.Checked = item.ItemVisible;
         string tip = itemXE.GetAttribute("Tip");
         if (itemXE.GetElementsByTagName("CreateFile").Count > 0)
         {
             if (!tip.IsNullOrWhiteSpace())
             {
                 tip += "\n";
             }
             tip += AppString.Tip.CommandFiles;
             if (System.Diagnostics.Debugger.IsAttached)
             {
                 item.ChkVisible.Checked = item.ItemVisible = true;
             }
         }
         MyToolTip.SetToolTip(item.ChkVisible, tip);
         this.AddItem(item);
     }
 }
 private void LoadShellItems(XmlNode shellXN, FoldGroupItem groupItem)
 {
     foreach (XmlElement itemXE in shellXN.SelectNodes("Item"))
     {
         if (!XmlDicHelper.FileExists(itemXE))
         {
             continue;
         }
         if (!XmlDicHelper.JudgeCulture(itemXE))
         {
             continue;
         }
         if (!XmlDicHelper.JudgeOSVersion(itemXE))
         {
             continue;
         }
         string keyName = itemXE.GetAttribute("KeyName");
         if (keyName.IsNullOrWhiteSpace())
         {
             continue;
         }
         EnhanceShellItem item = new EnhanceShellItem()
         {
             RegPath       = $@"{groupItem.GroupPath}\shell\{keyName}",
             FoldGroupItem = groupItem,
             ItemXE        = itemXE
         };
         foreach (XmlElement szXE in itemXE.SelectNodes("Value/REG_SZ"))
         {
             if (!XmlDicHelper.JudgeCulture(szXE))
             {
                 continue;
             }
             if (szXE.HasAttribute("MUIVerb"))
             {
                 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)
         {
             XmlElement cmdXE = (XmlElement)itemXE.SelectSingleNode("SubKey/Command");
             if (cmdXE != null)
             {
                 Icon icon = null;
                 if (cmdXE.HasAttribute("Default"))
                 {
                     string filePath = ObjectPath.ExtractFilePath(cmdXE.GetAttribute("Default"));
                     icon = ResourceIcon.GetIcon(filePath);
                 }
                 else
                 {
                     XmlNode fileXE = cmdXE.SelectSingleNode("FileName");
                     if (fileXE != null)
                     {
                         string filePath = ObjectPath.ExtractFilePath(fileXE.InnerText);
                         icon = ResourceIcon.GetIcon(filePath);
                     }
                 }
                 item.Image = icon?.ToBitmap();
                 icon?.Dispose();
             }
         }
         if (item.Image == null)
         {
             item.Image = AppImage.NotFound;
         }
         if (item.Text.IsNullOrWhiteSpace())
         {
             item.Text = keyName;
         }
         string tip = "";
         foreach (XmlElement tipXE in itemXE.SelectNodes("Tip"))
         {
             if (XmlDicHelper.JudgeCulture(tipXE))
             {
                 tip = tipXE.GetAttribute("Value");
             }
         }
         if (itemXE.GetElementsByTagName("CreateFile").Count > 0)
         {
             if (!tip.IsNullOrWhiteSpace())
             {
                 tip += "\n";
             }
             tip += AppString.Tip.CommandFiles;
         }
         ToolTipBox.SetToolTip(item.ChkVisible, tip);
         this.AddItem(item);
     }
 }