Beispiel #1
0
        public static bool Exists(string databaseRootPath, string hyphenKey, TankIconType type = TankIconType.Normal)
        {
            if (hyphenKey == VirtualTankIconKey)
            {
                return(true);
            }

            return(PackageStream.IsFileExisted(Path.Combine(databaseRootPath, PackageImage.GuiPackage), TankIcon.GetEntryKey(hyphenKey, type)));
        }
        public static bool Exists(string path)
        {
            string packagePath, localPath;

            UnifiedPath.ParsePath(path, out packagePath, out localPath);

            if (packagePath == null)
            {
                return(File.Exists(localPath));
            }

            return(PackageStream.IsFileExisted(packagePath, localPath));
        }
Beispiel #3
0
        public static BitmapSource Load(string databaseRootPath, string hyphenKey, double dpi = 96, TankIconType type = TankIconType.Normal)
        {
            if (hyphenKey == VirtualTankIconKey)
            {
                hyphenKey = "ussr-Observer";
            }

            var path = TankIcon.GetEntryKey(hyphenKey, type);

            if (PackageStream.IsFileExisted(Path.Combine(databaseRootPath, PackageImage.GuiPackage), path))
            {
                return(PackageImage.Load(databaseRootPath, PackageImage.GuiPackage, path));
            }
            return(PackageImage.Load(databaseRootPath, PackageImage.GuiPackage, TankIcon.GetEntryKey("noImage", type)));
        }