Esempio n. 1
0
        public override bool AddBlock(ToplistBlock block)
        {
            block.ThrowIfNull(nameof(block));

            int insertIndex = CalculateInsertIndex(block.Number);

            Blocks.Insert(insertIndex, block);

            return(true);
        }
Esempio n. 2
0
        private static XElement ConvertBlockToXElement(ToplistBlock block)
        {
            block.ThrowIfNull(nameof(block));

            return(new XElement("Block",
                                new XAttribute(nameof(ToplistBlock.Title), block.Title),
                                new XAttribute(nameof(ToplistBlock.Number), block.Number),

                                new XElement(nameof(block.Items),
                                             block.Items.Select(ConvertItemToXElement).ToArray()
                                             )
                                ));
        }
Esempio n. 3
0
        public override bool RemoveBlock(ToplistBlock block)
        {
            block.ThrowIfNull(nameof(block));

            return(Blocks.Remove(block));
        }
Esempio n. 4
0
        public void RemoveBlock(ToplistBlock block)
        {
            block.ThrowIfNull(nameof(block));

            _toplist.RemoveBlock(block);
        }