/// <summary> /// ArticleView merge /// </summary> /// <param name="articleView"></param> public void Restore(ArticleView original) { this.id = original.id; this.title = original.title; this.content = original.content; this.isShown = original.isShown; this.updated = original.updated; this.pageTitle = original.pageTitle; this.keywords = original.keywords; this.description = original.description; this.metaTag = original.metaTag; this.url = original.url; }
/// <summary> /// Clone /// </summary> /// <param name="articleView"></param> public ArticleView(ArticleView articleView) { this.id = articleView.id; this.title = articleView.title; this.content = articleView.content; this.isShown = articleView.isShown; this.updated = articleView.updated; this.pageTitle = articleView.pageTitle; this.keywords = articleView.keywords; this.description = articleView.description; this.metaTag = articleView.metaTag; this.url = articleView.url; }
/// <summary> /// 'Cancel' button is clicked /// </summary> public void CancelEdit() { Restore(cache); cache = null; }
/// <summary> /// 'Edit' button is clicked /// Due to binding, all UI changed will be mapped to the object, so we need make a copy of object before edit in case user wants to cancel the editing /// </summary> public void BeginEdit() { cache = new ArticleView(this); }