public void CreateEntry(ISublistEntry parent) { var newEntry = new SublistEntry(); if (parent != null) { parent.AddSubEntrySafely(newEntry); } else { AllEntries.Add(newEntry); } _entryProvider.StoreNewEntry(newEntry); RefreshAllEntries(); }
public void IndentItem(ISublistEntry entry, ISublistEntry newParent) { if (newParent != null) { var oldParent = _entryProvider.GetParent(entry, AllEntries); if (oldParent != null && oldParent.SubEntries.First() == entry) { return; } entry.ParentId = newParent.Id; newParent.AddSubEntrySafely(entry); oldParent?.SubEntries.Remove(entry); AllEntries.Remove(entry); _entryProvider.ChangeEntry(entry); RefreshAllEntries(); } }