예제 #1
0
        public void CreateEntry(ISublistEntry parent)
        {
            var newEntry = new SublistEntry();

            if (parent != null)
            {
                parent.AddSubEntrySafely(newEntry);
            }
            else
            {
                AllEntries.Add(newEntry);
            }

            _entryProvider.StoreNewEntry(newEntry);

            RefreshAllEntries();
        }
예제 #2
0
        public void CreateEntry(ISublistEntry parent)
        {
            var newEntry = new SublistEntry();

            if (parent != null)
            {
                parent.AddSubEntrySafely(newEntry);
            }
            else
            {
                AllEntries.Add(newEntry);
            }

            _entryProvider.StoreNewEntry(newEntry);

            RefreshAllEntries();
        }
예제 #3
0
        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();
            }
        }
예제 #4
0
        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();

            }
        }