Пример #1
0
        public void PositionRecords(List <RecordBase> sheetRecords)
        {
            // Take a copy to loop over, so we can update the real one
            //  without concurrency issues
            List <HeaderFooterRecord> hfRecordsToIterate      = new List <HeaderFooterRecord>(_sviewHeaderFooters);
            Dictionary <String, HeaderFooterRecord> hfGuidMap = new Dictionary <String, HeaderFooterRecord>();

            foreach (HeaderFooterRecord hf in hfRecordsToIterate)
            {
                string key = HexDump.ToHex(hf.Guid);
                if (hfGuidMap.ContainsKey(key))
                {
                    hfGuidMap[key] = hf;
                }
                else
                {
                    hfGuidMap.Add(HexDump.ToHex(hf.Guid), hf);
                }
            }

            // loop through HeaderFooterRecord records having not-empty GUID and match them with
            // CustomViewSettingsRecordAggregate blocks having UserSViewBegin with the same GUID
            foreach (HeaderFooterRecord hf in hfRecordsToIterate)
            {
                foreach (RecordBase rb in sheetRecords)
                {
                    if (rb is CustomViewSettingsRecordAggregate)
                    {
                        CustomViewSettingsRecordAggregate cv = (CustomViewSettingsRecordAggregate)rb;
                        cv.VisitContainedRecords(new CustomRecordVisitor1(cv, hf, _sviewHeaderFooters, hfGuidMap));
                    }
                }
            }
        }
Пример #2
0
        public void PositionRecords(List <RecordBase> sheetRecords)
        {
            // Take a copy to loop over, so we can update the real one
            //  without concurrency issues
            List <HeaderFooterRecord> hfRecordsToIterate = new List <HeaderFooterRecord>(_sviewHeaderFooters);

            // loop through HeaderFooterRecord records having not-empty GUID and match them with
            // CustomViewSettingsRecordAggregate blocks having UserSViewBegin with the same GUID
            foreach (HeaderFooterRecord hf in hfRecordsToIterate)
            {
                foreach (RecordBase rb in sheetRecords)
                {
                    if (rb is CustomViewSettingsRecordAggregate)
                    {
                        CustomViewSettingsRecordAggregate cv = (CustomViewSettingsRecordAggregate)rb;
                        cv.VisitContainedRecords(new CustomRecordVisitor1(cv, hf, _sviewHeaderFooters));
                    }
                }
            }
        }