예제 #1
0
        public static ArchivedSongVersion Create(Song song, SongDiff diff, AgentLoginData author, SongArchiveReason reason, string notes)
        {
            var contract = new ArchivedSongContract(song, diff);
            var data     = XmlHelper.SerializeToXml(contract);

            return(song.CreateArchivedVersion(data, diff, author, reason, notes));
        }
예제 #2
0
        public static ArchivedTagVersion Create(Tag tag, TagDiff diff, AgentLoginData author, EntryEditEvent commonEditEvent, string notes)
        {
            var contract = new ArchivedTagContract(tag, diff);
            var data     = XmlHelper.SerializeToXml(contract);

            return(tag.CreateArchivedVersion(data, diff, author, commonEditEvent, notes));
        }
예제 #3
0
        public void AuditLog(string doingWhat, string who, AuditLogCategory category = AuditLogCategory.Unspecified)
        {
            SysLog(doingWhat, who);

            var agentLoginData = new AgentLoginData(who);
            var entry          = new AuditLogEntry(agentLoginData, doingWhat, category, GlobalEntryId.Empty);

            Ctx.Save(entry);
        }
예제 #4
0
        public DiscussionTopic(DiscussionFolder folder, string name, string content, AgentLoginData agent)
        {
            Folder = folder;
            Name   = name;
            CreateComment(content, agent);
            AuthorName = agent.Name;

            Created = DateTime.Now;
        }
예제 #5
0
        public ArchivedTagVersion(Tag tag, XDocument data, TagDiff diff, AgentLoginData author,
                                  EntryEditEvent commonEditEvent, string notes)
            : base(data, author, tag.Version, tag.Status, notes)
        {
            ParamIs.NotNull(() => diff);

            Tag             = tag;
            Diff            = diff;
            CommonEditEvent = commonEditEvent;
        }
예제 #6
0
        public void AuditLog(string doingWhat, AgentLoginData who, AuditLogCategory category = AuditLogCategory.Unspecified)
        {
            ParamIs.NotNull(() => who);

            SysLog(doingWhat, who.Name);

            var entry = new AuditLogEntry(who, doingWhat, category, GlobalEntryId.Empty);

            Ctx.Save(entry);
        }
예제 #7
0
        public ArchivedSongVersion(Song song, XDocument data, SongDiff diff, AgentLoginData author, int version, EntryStatus status,
                                   SongArchiveReason reason, string notes)
            : base(data, author, version, status, notes)
        {
            ParamIs.NotNull(() => data);

            Song   = song;
            Diff   = diff;
            Reason = reason;
        }
예제 #8
0
        public virtual Comment CreateComment(string message, AgentLoginData author)
        {
            ParamIs.NotNullOrEmpty(() => message);
            ParamIs.NotNull(() => author);

            var comment = new ArtistComment(this, message, author);

            Comments.Add(comment);

            return(comment);
        }
예제 #9
0
        protected void AuditLog(string doingWhat, ISession session, AgentLoginData who, AuditLogCategory category = AuditLogCategory.Unspecified)
        {
            ParamIs.NotNull(() => session);
            ParamIs.NotNull(() => who);

            SysLog(doingWhat, who.Name);

            var entry = new AuditLogEntry(who, doingWhat, category, GlobalEntryId.Empty);

            session.Save(entry);
        }
예제 #10
0
        public ArchivedSongListVersion(SongList songList, SongListDiff diff, AgentLoginData author,
                                       EntryStatus status,
                                       EntryEditEvent commonEditEvent, string notes)
            : base(null, author, songList.Version, status, notes)
        {
            ParamIs.NotNull(() => diff);

            SongList        = songList;
            Diff            = diff;
            CommonEditEvent = commonEditEvent;
        }
예제 #11
0
        /// <summary>
        /// Creates an archived version of an album.
        /// </summary>
        /// <param name="album">Album to be archived. Cannot be null.</param>
        /// <param name="diff">Album diff. Cannot be null.</param>
        /// <param name="author">User creating the archived version. Cannot be null.</param>
        /// <param name="reason">Reason for archiving.</param>
        /// <param name="notes">Free-form edit notes. Cannot be null.</param>
        /// <returns>Archived album version. Cannot be null.</returns>
        /// <exception cref="XmlException">If the entry could not be serialized. This could happen if the object contains illegal characters.</exception>
        public static ArchivedAlbumVersion Create(Album album, AlbumDiff diff, AgentLoginData author, AlbumArchiveReason reason, string notes)
        {
            ParamIs.NotNull(() => album);
            ParamIs.NotNull(() => diff);
            ParamIs.NotNull(() => author);
            ParamIs.NotNull(() => notes);

            var contract = new ArchivedAlbumContract(album, diff);
            var data     = XmlHelper.SerializeToXml(contract);

            return(album.CreateArchivedVersion(data, diff, author, reason, notes));
        }
예제 #12
0
        public ArchivedSongListVersion(SongList songList, SongListDiff diff, AgentLoginData author,
                                       EntryEditEvent commonEditEvent)
            : base(null, author, 0, EntryStatus.Finished, string.Empty)
        {
            ParamIs.NotNull(() => diff);

            SongList        = songList;
            Diff            = diff;
            CommonEditEvent = commonEditEvent;

            Status = EntryStatus.Finished;
        }
예제 #13
0
        public ArchivedTagVersion(Tag tag, TagDiff diff, AgentLoginData author,
                                  EntryEditEvent commonEditEvent)
            : base(null, author, 0, EntryStatus.Finished, string.Empty)
        {
            ParamIs.NotNull(() => diff);

            Tag             = tag;
            Diff            = diff;
            CommonEditEvent = commonEditEvent;
            CategoryName    = tag.CategoryName;
            Description     = tag.Description;
            Status          = EntryStatus.Finished;
        }
예제 #14
0
        public ArchivedArtistVersion(Artist artist, XDocument data, ArtistDiff diff, AgentLoginData author, int version, EntryStatus status,
                                     ArtistArchiveReason reason, string notes)
            : base(data, author, version, status, notes)
        {
            ParamIs.NotNull(() => data);

            Artist = artist;
            Diff   = diff;
            Reason = reason;

            if (diff.IncludePicture)
            {
                Picture = artist.Picture;
            }
        }
예제 #15
0
        public ArchivedAlbumVersion(Album album, XDocument data, AlbumDiff diff, AgentLoginData author, int version, EntryStatus status,
                                    AlbumArchiveReason reason, string notes)
            : base(data, author, version, status, notes)
        {
            ParamIs.NotNull(() => data);
            ParamIs.NotNull(() => diff);

            Album  = album;
            Diff   = diff;
            Reason = reason;

            if (diff.IncludeCover)
            {
                CoverPicture = album.CoverPictureData;
            }
        }