Esempio n. 1
0
        private static void DoIfExists(ArchivedAlbumVersion version, AlbumEditableFields field, XmlCache <ArchivedAlbumContract> xmlCache, Action <ArchivedAlbumContract, XDocument> func)
        {
            var versionWithField = version.GetLatestVersionWithField(field);

            if (versionWithField != null && versionWithField.Data != null)
            {
                var data = xmlCache.Deserialize(versionWithField.Version, versionWithField.Data);
                func(data, versionWithField.Data);
            }
        }
		private static void DoIfExists(ArchivedAlbumVersion version, AlbumEditableFields field, XmlCache<ArchivedAlbumContract> xmlCache, Action<ArchivedAlbumContract, XDocument> func) {

			var versionWithField = version.GetLatestVersionWithField(field);

			if (versionWithField != null && versionWithField.Data != null) {
				var data = xmlCache.Deserialize(versionWithField.Version, versionWithField.Data);
				func(data, versionWithField.Data);
			}

		}
        public static EntryForPictureDisplayContract Create(ArchivedAlbumVersion archivedVersion, 
            ContentLanguagePreference languagePreference)
        {
            ParamIs.NotNull(() => archivedVersion);

            var name = archivedVersion.Album.TranslatedName[languagePreference];
            var versionWithPic = archivedVersion.GetLatestVersionWithField(AlbumEditableFields.Cover);
            PictureContract pic = null;

            if (versionWithPic != null && versionWithPic.CoverPicture != null)
                pic = new PictureContract(versionWithPic.CoverPicture, Size.Empty);

            return new EntryForPictureDisplayContract(
                EntryType.Album, archivedVersion.Album.Id, name, archivedVersion.Version, pic);
        }
Esempio n. 4
0
        public static EntryForPictureDisplayContract Create(ArchivedAlbumVersion archivedVersion,
                                                            ContentLanguagePreference languagePreference)
        {
            ParamIs.NotNull(() => archivedVersion);

            var             name           = archivedVersion.Album.TranslatedName[languagePreference];
            var             versionWithPic = archivedVersion.GetLatestVersionWithField(AlbumEditableFields.Cover);
            PictureContract pic            = null;

            if (versionWithPic != null && versionWithPic.CoverPicture != null)
            {
                pic = new PictureContract(versionWithPic.CoverPicture, versionWithPic.CoverPictureMime);
            }

            return(new EntryForPictureDisplayContract(
                       EntryType.Album, archivedVersion.Album.Id, name, archivedVersion.Version, pic));
        }