示例#1
0
        public void GenerateOutput(bool sortBlockOrder)
        {
            // Should we sort block order?
            if (sortBlockOrder)
            {
                OrderedBlocks.Sort();
            }

            StringBuilder result = new StringBuilder();

            OrderedBlocks.ForEach(blockName => result.Append(Blocks[blockName].GetOutputContent()));
            Output = result.ToString();
        }
示例#2
0
        public FileBlockInfo GetBlock(string blockName)
        {
            // Create object for provided block name
            FileBlockInfo fileBlockInfo = new FileBlockInfo(this, blockName);

            // Look for proper one block on the list
            if (Blocks.ContainsKey(blockName))
            {
                fileBlockInfo = Blocks[blockName];
            }
            else
            {
                Blocks.Add(blockName, fileBlockInfo);
                OrderedBlocks.Add(blockName);
            }

            // Return result
            return(fileBlockInfo);
        }
示例#3
0
 public int TotalPriceSurcharge()
 {
     return(OrderedBlocks.Sum(b => b.AdditionalChargeTotal()));
 }