private void AttachMeterDetails(GaugingSummary gaugingSummary, PocketGaugerFiles pocketGaugerFiles)
        {
            var meterDetails = _meterDetailsParser.Parse(pocketGaugerFiles);

            foreach (var gaugingSummaryItem in gaugingSummary.GaugingSummaryItems)
            {
                gaugingSummaryItem.MeterDetailsItem = meterDetails[gaugingSummaryItem.MeterId];
            }
        }
        public GaugingSummary Assemble(PocketGaugerFiles pocketGaugerFiles)
        {
            var gaugingSummary = _gaugingSummaryParser.Parse(pocketGaugerFiles);

            AttachMeterDetails(gaugingSummary, pocketGaugerFiles);
            AttachPanelItems(gaugingSummary, pocketGaugerFiles);

            return(gaugingSummary);
        }
        private void AttachPanelItems(GaugingSummary gaugingSummary, PocketGaugerFiles pocketGaugerFiles)
        {
            var panelItems = _panelParser.Parse(pocketGaugerFiles);

            foreach (var gaugingSummaryItem in gaugingSummary.GaugingSummaryItems)
            {
                gaugingSummaryItem.PanelItems =
                    panelItems.Where(p => p.GaugingId == gaugingSummaryItem.GaugingId).ToList();
            }
        }
コード例 #4
0
        private static PocketGaugerFiles GetZipContents(ZipArchive zipArchive)
        {
            var streams = new PocketGaugerFiles();

            foreach (var zipArchiveEntry in zipArchive.Entries)
            {
                streams[zipArchiveEntry.Name.ToLower()] = zipArchiveEntry.Open();
            }

            return(streams);
        }