Exemplo n.º 1
0
 private CommandID GetIcon(Configuration.Icon icon)
 {
     if (icon != null)
     {
         Guid iconGuid = this.defaultIcon.Guid;
         int  iconId   = this.defaultIcon.ID;
         if (icon.IDSpecified)
         {
             iconId = icon.ID;
             if (icon.Guid == null)
             {
                 iconGuid = ShellCmdDef.guidOfficeIcon;
             }
         }
         if (icon.Guid != null)
         {
             iconGuid = new Guid(icon.Guid);
         }
         return(ShellCmdDef.MapIconToBitmap(new CommandID(iconGuid, iconId)));
     }
     else
     {
         return(this.defaultIcon);
     }
 }
Exemplo n.º 2
0
 private CommandID CreateBitmap(IVsTemplate template)
 {
     if (!string.IsNullOrEmpty(template.IconFileName))
     {
         string fileIcon = new FileInfo(template.FileName).Directory + "\\" + template.IconFileName;
         return(LoadBitmap(fileIcon));
     }
     return(ShellCmdDef.MapIconToBitmap(template.Icon));
 }