public MovePostAction(Chapter cSource, Post pSource, Chapter cTarget, Post pTarget = null) { this.cSource = cSource; this.pSource = pSource; this.cTarget = cTarget; this.pTarget = pTarget; }
/// <summary> /// Generalized sort comparison function for ordering chapters. /// </summary> /// <returns><c>0</c> if equal, <c><0</c> if <c>a</c> sorts before <c>b</c>, and <c>>0</c> if <c>b</c> sorts before <c>a</c>.</returns> public static int ChapterSort(Chapter a, Chapter b) { int c = a.Ordering - b.Ordering; if (c != 0) return c; return a.Title.CompareTo(b.Title); }
public SplitPostAction(Chapter chapter, Post post, string existingTitle, string existingContent, string splitTitle, string splitContent) : base() { Post splitPost = new Post(splitTitle, post.Author, splitContent); edit = new EditPostAction(post, existingContent, existingTitle); add = new AddPostAction(chapter, splitPost); }
public CombinePostsAction(Chapter chapter, Post a, Post b) { this.chapter = chapter; this.a = a; this.b = b; this.deleteAction = new DeletePostAction(chapter, b); }
public AddPostAction(Chapter chapter, Post post) { this.chapter = chapter; this.post = post; }
/// <summary> /// Adds <c>newChapter</c> to the given <see cref="Book"/> immediately /// following the <c>precedingChapter</c>. /// </summary> /// <param name="newChapter">The chapter to add.</param> /// <param name="precedingChapter">The chapter immediately before the /// insertion point, or <c>null</c> if adding to the beginning.</param> public AddChapterAction(Book book, Chapter newChapter, Chapter precedingChapter) { this.book = book; this.newChapter = newChapter; this.precedingChapter = precedingChapter; }
public MoveChapterAction(Chapter source, Book book, Chapter target = null) { this.book = book; this.source = source; this.target = target; }