Exemplo n.º 1
0
        public void AddImage(PassbookImageType imageType, byte[] imageBytes)
        {
            if (this.Images == null)
            {
                this.Images = new SerializableDictionary <PassbookImageType, byte[]>();
            }

            if (this.Images.ContainsKey(imageType))
            {
                this.Images[imageType] = imageBytes;
            }
            else
            {
                this.Images.Add(imageType, imageBytes);
            }
        }
Exemplo n.º 2
0
        public static string ToFilename(this PassbookImageType passbookImage)
        {
            switch (passbookImage)
            {
            case PassbookImageType.Icon:
                return("icon.png");

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

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

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

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

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

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

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

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

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

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

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

            default:
                throw new NotImplementedException("Unknown PassbookImageType type.");
            }
        }