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 posts by publication date. /// </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 PostSortByPubDate(Post a, Post b) { int c = (int)a.PublishDate.Subtract(b.PublishDate).TotalSeconds; if (c != 0) return c; return a.Title.CompareTo(b.Title); }
/// <summary> /// Generalized sort comparison function for ordering posts. /// </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 PostSort(Post a, Post b) { int c = a.Ordering - b.Ordering; if (c != 0) return c; return a.Title.CompareTo(b.Title); }
public EditPostAction(Post post, string newContent, string newTitle = null) : base() { this.post = post; this.afterContent = newContent; this.afterTitle = newTitle; }
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 SplitPostDialog(Post post) : this() { splitPointText.Text = post.Content; int halfLength = splitPointText.Text.Length / 2; splitPointText.SelectionStart = halfLength; splitPointText.Select(halfLength, halfLength + 1); existingTitleText.Text = post.Title + " (Part 1)"; splitTitleText.Text = post.Title + " (Part 2)"; }
public AddPostAction(Chapter chapter, Post post) { this.chapter = chapter; this.post = post; }
/// <summary> /// Returns a string containing the HTML representation of the given <see cref="Post"/>. /// </summary> /// <param name="p">The post.</param> public static string ToHtml(Post p) { return ToHtml(p.Content, p.Title, p.Author); }