/// <summary> /// ItemView merge /// </summary> /// <param name="itemView"></param> public void Restore(TabView original) { this.id = original.id; this.name = original.name; this.isShown = original.isShown; this.content = original.content; this.showOrder = original.showOrder; this.pageTitle = original.pageTitle; this.url = original.url; this.keywords = original.keywords; this.description = original.description; this.metaTag = original.metaTag; this.updated = original.updated; }
/// <summary> /// Clone /// </summary> /// <param name="categoryView"></param> public TabView(TabView tabView) { this.id = tabView.id; this.name = tabView.name; this.isShown = tabView.isShown; this.content = tabView.content; this.showOrder = tabView.showOrder; this.updated = tabView.updated; this.pageTitle = tabView.pageTitle; this.keywords = tabView.keywords; this.description = tabView.description; this.metaTag = tabView.metaTag; this.url = tabView.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 TabView(this); }