Beispiel #1
0
 private static SmallIconManager.SmallIcon GetFolderSmallIcon(UserContext userContext, string containerClass, FolderSharingFlag sharingFlag)
 {
     SmallIconManager.SmallIcon smallIcon;
     if (containerClass == null)
     {
         smallIcon = SmallIconManager.normalFolderIcon;
     }
     else
     {
         smallIcon = SmallIconManager.LookupSmallIcon(containerClass, -1);
         if (smallIcon == null)
         {
             smallIcon = SmallIconManager.PrefixMatchLookupSmallIcon(containerClass, -1);
             if (smallIcon == null)
             {
                 smallIcon = SmallIconManager.normalFolderIcon;
             }
         }
     }
     if (!smallIcon.IsCustom && sharingFlag != FolderSharingFlag.None)
     {
         smallIcon = (SmallIconManager.GetIconForSharedFolder(containerClass, sharingFlag) ?? smallIcon);
     }
     return(smallIcon);
 }
Beispiel #2
0
 private static SmallIconManager.SmallIcon GetFileSmallIcon(UserContext userContext, string fileExtension, int iconFlag)
 {
     SmallIconManager.SmallIcon smallIcon = SmallIconManager.LookupSmallIcon(fileExtension, iconFlag);
     if (smallIcon == null)
     {
         smallIcon = new SmallIconManager.SmallIcon(129, -1018465893);
     }
     return(smallIcon);
 }
Beispiel #3
0
 public static SmallIconManager.SmallIcon GetItemSmallIcon(string itemClass, string defaultItemClass, bool isInConflict, bool isRead, int iconFlag)
 {
     if (isInConflict)
     {
         return(new SmallIconManager.SmallIcon(82, -1240042979));
     }
     if (!EnumValidator.IsValidValue <IconIndex>((IconIndex)iconFlag))
     {
         iconFlag = -1;
     }
     if (iconFlag == -1 && isRead)
     {
         iconFlag = 256;
     }
     else if (iconFlag == 306 && isRead)
     {
         iconFlag = 256;
     }
     SmallIconManager.SmallIcon smallIcon = SmallIconManager.LookupSmallIcon(itemClass, iconFlag);
     if (smallIcon == null && iconFlag == 256)
     {
         iconFlag  = -1;
         smallIcon = SmallIconManager.LookupSmallIcon(itemClass, iconFlag);
     }
     if (iconFlag == -1 && isRead && smallIcon == null)
     {
         smallIcon = SmallIconManager.PrefixMatchLookupSmallIcon(itemClass, 256);
     }
     if (smallIcon == null)
     {
         smallIcon = SmallIconManager.PrefixMatchLookupSmallIcon(itemClass, iconFlag);
     }
     if (smallIcon == null)
     {
         smallIcon = SmallIconManager.LookupSmallIcon(itemClass, -1);
     }
     if (smallIcon == null && defaultItemClass != null)
     {
         smallIcon = SmallIconManager.LookupSmallIcon(defaultItemClass, iconFlag);
     }
     if (smallIcon == null && defaultItemClass != null)
     {
         smallIcon = SmallIconManager.PrefixMatchLookupSmallIcon(defaultItemClass, iconFlag);
     }
     if (smallIcon == null && (iconFlag == 261 || iconFlag == 262))
     {
         smallIcon = SmallIconManager.LookupSmallIcon("IPM.Note", iconFlag);
     }
     if (smallIcon == null)
     {
         smallIcon = (isRead ? new SmallIconManager.SmallIcon(132, -1075414859) : new SmallIconManager.SmallIcon(133, -1679159840));
     }
     return(smallIcon);
 }