Beispiel #1
0
        public byte[] GetImage(PassbookImage passbookImage)
        {
            byte[] value;

            if (mImages.TryGetValue(passbookImage, out value))
            {
                return(value);
            }

            return(null);
        }
Beispiel #2
0
        public void AddImage(PassbookImage passbookImage, string fileName)
        {
            string path = MapPath(fileName);

            if (!File.Exists(path))
            {
                throw new FileNotFoundException("Image '{0}' could not be found.", path);
            }

            mImages[passbookImage] = File.ReadAllBytes(path);
        }
Beispiel #3
0
        public static string ToFilename(this PassbookImage passbookImage)
        {
            switch (passbookImage)
            {
            case PassbookImage.Icon:
                return("icon.png");

            case PassbookImage.IconRetina:
                return("*****@*****.**");

            case PassbookImage.Logo:
                return("logo.png");

            case PassbookImage.LogoRetina:
                return("*****@*****.**");

            case PassbookImage.Background:
                return("background.png");

            case PassbookImage.BackgroundRetina:
                return("*****@*****.**");

            case PassbookImage.Strip:
                return("strip.png");

            case PassbookImage.StripRetina:
                return("*****@*****.**");

            case PassbookImage.Thumbnail:
                return("thumbnail.png");

            case PassbookImage.ThumbnailRetina:
                return("*****@*****.**");

            case PassbookImage.Footer:
                return("footer.png");

            case PassbookImage.FooterRetina:
                return("*****@*****.**");

            default:
                throw new NotImplementedException("Unknown PassbookImage type.");
            }
        }
Beispiel #4
0
 public void AddImage(PassbookImage passbookImage, byte[] fileData)
 {
     mImages[passbookImage] = fileData;
 }