Ejemplo n.º 1
0
        public static Imaging.ImageFile GetIcon(IO.PackCollection pack, Language language, int nr)
        {
            var type = language.GetCode();

            if (type.Length > 0)
            {
                type = type + "/";
            }
            return(GetIcon(pack, type, nr));
        }
Ejemplo n.º 2
0
        public static Imaging.ImageFile GetIcon(IO.PackCollection pack, string type, int nr)
        {
            type = type ?? string.Empty;
            if (type.Length > 0 && !type.EndsWith("/"))
            {
                type = type + "/";
            }

            var filePath = string.Format(IconFileFormat, nr / 1000, type, nr);

            if (!pack.TryGetFile(filePath, out var file) && type.Length > 0)
            {
                // Couldn't get specific type, try for generic version.
                filePath = string.Format(IconFileFormat, nr / 1000, string.Empty, nr);
                if (!pack.TryGetFile(filePath, out file))
                {
                    // Couldn't get generic version either, that's a shame.
                    file = null;
                }
            }
            return(file as Imaging.ImageFile);
        }
Ejemplo n.º 3
0
 public static Imaging.ImageFile GetIcon(IO.PackCollection pack, int nr)
 {
     return(GetIcon(pack, string.Empty, nr));
 }