private void AddParent() { JournalQuest newParent = new JournalQuest(); //newParent.OrderIndex = prntForm.journal.categories.Count; newParent.Tag = "catTag" + prntForm.mod.nextIdNumber.ToString(); prntForm.journal.Add(newParent); UpdateTreeView(); }
private void AddChild(string parentTag) { JournalQuest pnt = GetParentByTag(parentTag); JournalEntry newChild = new JournalEntry(); //newChild.OrderIndex = pnt.Entries.Count; newChild.Tag = "entryTag" + prntForm.mod.nextIdNumber.ToString(); pnt.Entries.Add(newChild); UpdateTreeView(); }
public JournalQuest DeepCopy() { JournalQuest other = (JournalQuest)this.MemberwiseClone(); other.Entries = new List <JournalEntry>(); foreach (JournalEntry jent in this.entries) { JournalEntry j = jent.DeepCopy(); other.Entries.Add(j); } return(other); }
private void JournalEditor_Load(object sender, EventArgs e) { if (prntForm.journal.Count == 0) { JournalQuest newCat = new JournalQuest(); //newCat.OrderIndex = prntForm.journal.categories.Count; newCat.Tag = "catTag" + prntForm.mod.nextIdNumber.ToString(); prntForm.journal.Add(newCat); JournalEntry newEntry = new JournalEntry(); //newEntry.OrderIndex = newCat.Entries.Count; newEntry.Tag = "entryTag" + prntForm.mod.nextIdNumber.ToString(); newCat.Entries.Add(newEntry); } UpdateTreeView(); }