public static Texture2D Get(int n) { if (packageResourceIcons == null) { packageResourceIcons = new IconDictionary(PackageResource.i); } return(packageResourceIcons.Get(n)); }
private void ExtractIcon(string key, string path) { IconsSet.Add(key); Icon smallIcon, largeIcon; if (IconDictionary.TryGetValue(key, out IconPair icons)) { smallIcon = icons.Small; largeIcon = icons.Large; } else { //TODO: type names string typeName = NativeIcon.GetIconsAndTypeName(path, out smallIcon, out largeIcon); IconDictionary.Add(key, new IconPair(smallIcon, largeIcon)); } LargeIcons.Images.Add(key, largeIcon); SmallIcons.Images.Add(key, smallIcon); }