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(); }
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); }
public int TotalPriceSurcharge() { return(OrderedBlocks.Sum(b => b.AdditionalChargeTotal())); }