Пример #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 CustomRecordVisitor1(CustomViewSettingsRecordAggregate cv, HeaderFooterRecord hf,
                             List <HeaderFooterRecord> sviewHeaderFooter, Dictionary <String, HeaderFooterRecord> hfGuidMap)
 {
     this._cv = cv;
     this._hf = hf;
     this._sviewHeaderFooters = sviewHeaderFooter;
     _hfGuidMap = hfGuidMap;
 }
Пример #3
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));
                    }
                }
            }
        }
Пример #4
0
 public CustomRecordVisitor1(CustomViewSettingsRecordAggregate cv, HeaderFooterRecord hf, 
     List<HeaderFooterRecord> sviewHeaderFooter, Dictionary<String, HeaderFooterRecord> hfGuidMap)
 {
     this._cv = cv;
     this._hf = hf;
     this._sviewHeaderFooters = sviewHeaderFooter;
     _hfGuidMap = hfGuidMap;
 }
Пример #5
0
 public CustomRecordVisitor1(CustomViewSettingsRecordAggregate cv, HeaderFooterRecord hf, List<HeaderFooterRecord> sviewHeaderFooter)
 {
     this._cv = cv;
     this._hf = hf;
     this._sviewHeaderFooters = sviewHeaderFooter;
 }
Пример #6
0
 public CustomRecordVisitor1(CustomViewSettingsRecordAggregate cv, HeaderFooterRecord hf, List <HeaderFooterRecord> sviewHeaderFooter)
 {
     this._cv = cv;
     this._hf = hf;
     this._sviewHeaderFooters = sviewHeaderFooter;
 }