Exemplo n.º 1
0
 public MovePostAction(Chapter cSource, Post pSource, Chapter cTarget, Post pTarget = null)
 {
     this.cSource = cSource;
     this.pSource = pSource;
     this.cTarget = cTarget;
     this.pTarget = pTarget;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Generalized sort comparison function for ordering chapters.
        /// </summary>
        /// <returns><c>0</c> if equal, <c>&lt;0</c> if <c>a</c> sorts before <c>b</c>, and <c>&gt;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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        public CombinePostsAction(Chapter chapter, Post a, Post b)
        {
            this.chapter = chapter;
            this.a = a;
            this.b = b;

            this.deleteAction = new DeletePostAction(chapter, b);
        }
Exemplo n.º 5
0
 public AddPostAction(Chapter chapter, Post post)
 {
     this.chapter = chapter;
     this.post = post;
 }
Exemplo n.º 6
0
 /// <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;
 }
Exemplo n.º 7
0
 public MoveChapterAction(Chapter source, Book book, Chapter target = null)
 {
     this.book = book;
     this.source = source;
     this.target = target;
 }