public ArchivedAlbumVersionDetailsContract(ArchivedAlbumVersion archived, ArchivedAlbumVersion comparedVersion, 
            ContentLanguagePreference languagePreference)
        {
            Album = new AlbumContract(archived.Album, languagePreference);
            ArchivedVersion = new ArchivedAlbumVersionContract(archived);
            ComparedVersion = comparedVersion != null ? new ArchivedAlbumVersionContract(comparedVersion) : null;
            Name = Album.Name;

            ComparableVersions = archived.Album.ArchivedVersionsManager.Versions
                .Where(v => v != archived)
                .Select(a => new ArchivedObjectVersionContract(a))
                .ToArray();

            Versions = ComparedAlbumsContract.Create(archived, comparedVersion);

            ComparedVersionId = Versions.SecondId;
        }
        public ArchivedAlbumVersionDetailsContract(ArchivedAlbumVersion archived, ArchivedAlbumVersion comparedVersion,
                                                   ContentLanguagePreference languagePreference)
        {
            Album           = new AlbumContract(archived.Album, languagePreference);
            ArchivedVersion = new ArchivedAlbumVersionContract(archived);
            ComparedVersion = comparedVersion != null ? new ArchivedAlbumVersionContract(comparedVersion) : null;
            Name            = Album.Name;

            ComparableVersions = archived.Album.ArchivedVersionsManager.Versions
                                 .Where(v => v != archived)
                                 .Select(a => new ArchivedObjectVersionContract(a))
                                 .ToArray();

            Versions = ComparedAlbumsContract.Create(archived, comparedVersion);

            ComparedVersionId = Versions.SecondId;
        }
        public ArchivedAlbumVersionDetailsContract(ArchivedAlbumVersion archived, ArchivedAlbumVersion comparedVersion,
                                                   ContentLanguagePreference languagePreference)
        {
            ParamIs.NotNull(() => archived);

            Album           = new AlbumContract(archived.Album, languagePreference);
            ArchivedVersion = new ArchivedAlbumVersionContract(archived);
            ComparedVersion = comparedVersion != null ? new ArchivedAlbumVersionContract(comparedVersion) : null;
            Name            = Album.Name;

            ComparableVersions = archived.Album.ArchivedVersionsManager
                                 .GetPreviousVersions(archived)
                                 .Select(a => ArchivedObjectVersionWithFieldsContract.Create(a, a.Diff.ChangedFields.Value, a.Reason))
                                 .ToArray();

            Versions = ComparedAlbumsContract.Create(archived, comparedVersion);

            ComparedVersionId = Versions.SecondId;
        }
Exemplo n.º 4
0
 public static ArchivedObjectVersion CreateForAlbum(ArchivedAlbumVersionContract album)
 {
     return new ArchivedObjectVersion(album, GetReasonName(album.Reason, album.Notes),
         GetChangeString(album.ChangedFields), album.Reason != AlbumArchiveReason.PropertiesUpdated || album.ChangedFields != AlbumEditableFields.Nothing);
 }
Exemplo n.º 5
0
 public static ArchivedObjectVersion CreateForAlbum(ArchivedAlbumVersionContract album)
 {
     return new ArchivedObjectVersion(album, GetReasonName(album.Reason, album.Notes),
         GetChangeString(album.ChangedFields));
 }