コード例 #1
0
        public void DecrementSection(StoreSection section)
        {
            var sections = Sections.ToList();

            int sectionIndex = sections.IndexOf(section);

            if (sectionIndex == -1 || sectionIndex <= 0)
            {
                return;
            }

            var tmp = sections[sectionIndex - 1];

            sections[sectionIndex - 1] = section;
            sections[sectionIndex]     = tmp;

            UpdateSortingIndexes(sections);

            Sections = new SortedSet <StoreSection>(sections, new SortingIndexComparer());
        }
コード例 #2
0
        public void AddSection()
        {
            var section = new StoreSection(new StoreSectionId(Guid.NewGuid()), "", Sections.Max(s => s.SortingIndex) + 1, false);

            Sections.Add(section);
        }