public ArchivedSongVersionDetailsContract(ArchivedSongVersion archived, ArchivedSongVersion comparedVersion, ContentLanguagePreference languagePreference)
        {
            ArchivedVersion = new ArchivedSongVersionContract(archived);
            ComparedVersion = comparedVersion != null ? new ArchivedSongVersionContract(comparedVersion) : null;
            ComparedVersionId = comparedVersion != null ? comparedVersion.Id : 0;
            Song = new SongContract(archived.Song, languagePreference);
            Name = Song.Name;

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

            Versions = ComparedSongsContract.Create(archived, comparedVersion);

            ComparedVersionId = Versions.SecondId;
        }
        public ArchivedSongVersionDetailsContract(ArchivedSongVersion archived, ArchivedSongVersion comparedVersion, ContentLanguagePreference languagePreference)
        {
            ArchivedVersion   = new ArchivedSongVersionContract(archived);
            ComparedVersion   = comparedVersion != null ? new ArchivedSongVersionContract(comparedVersion) : null;
            ComparedVersionId = comparedVersion != null ? comparedVersion.Id : 0;
            Song = new SongContract(archived.Song, languagePreference);
            Name = Song.Name;

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

            Versions = ComparedSongsContract.Create(archived, comparedVersion);

            ComparedVersionId = Versions.SecondId;
        }
Ejemplo n.º 3
0
        public ArchivedSongVersionDetailsContract(ArchivedSongVersion archived, ArchivedSongVersion comparedVersion, IUserPermissionContext permissionContext)
        {
            ParamIs.NotNull(() => archived);

            ArchivedVersion   = new ArchivedSongVersionContract(archived);
            ComparedVersion   = comparedVersion != null ? new ArchivedSongVersionContract(comparedVersion) : null;
            ComparedVersionId = comparedVersion != null ? comparedVersion.Id : 0;
            Song = new SongContract(archived.Song, permissionContext.LanguagePreference);
            Name = Song.Name;

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

            Versions = ComparedSongsContract.Create(archived, comparedVersion);

            ComparedVersionId = Versions.SecondId;
        }
Ejemplo n.º 4
0
 public static ArchivedObjectVersion CreateForSong(ArchivedSongVersionContract artist)
 {
     return new ArchivedObjectVersion(artist, GetReasonName(artist.Reason, artist.Notes),
         GetChangeString(artist.ChangedFields));
 }
Ejemplo n.º 5
0
 public static ArchivedObjectVersion CreateForSong(ArchivedSongVersionContract song)
 {
     return new ArchivedObjectVersion(song, GetReasonName(song.Reason, song.Notes),
         GetChangeString(song.ChangedFields), song.Reason != SongArchiveReason.PropertiesUpdated || song.ChangedFields != SongEditableFields.Nothing);
 }