internal void Init(InstanceOffset[] offsets, int[] shifts) { RejectResult(); LastSection = ""; LastSectionRestartsOffset = 0; // Shifts = shifts; // Offsets = offsets; SectionStartOffset.Clear(); _sectionBorders.Clear(); SavedNames.Clear(); }
//-------------------------------------------------------------------- #region Impl internal int ConvertOffset(int offset, uint sectionId) { if (!SectionStartOffset.ContainsKey((int)sectionId)) { string msg = "Mismatch between section names in primary parsing and body extraction [" + sectionId + "] on offset=[" + offset + "], resource type=[" + Core.ResourceStore.LoadResource(ResId).Type + "];"; foreach (string str in SavedNames.Keys) { msg += " Saved section dump [" + str + "] with Id=" + (int)SavedNames[str]; } IResourceList sections = Core.ResourceStore.GetAllResources(DocumentSectionResource.DocSectionResName); foreach (IResource section in sections) { msg += " DocSection Dump: name=" + section.GetStringProp("Name") + " with order=" + section.GetIntProp("SectionOrder"); } throw new ApplicationException("ContextConstruction -- " + msg); } return(offset + SectionStartOffset[(int)sectionId]); }
private void AnalyzeSectionBorder(string sectionName) { if (sectionName != LastSection) { if (AccumulatedBody.Length > 0) { _sectionBorders.Add(AccumulatedBody.Length); } int sectionId = (int)DocSectionHelper.OrderByFullName(sectionName); if (!SectionStartOffset.ContainsKey(sectionId)) { SectionStartOffset[sectionId] = LastSectionRestartsOffset; } LastSection = sectionName; LastSectionId = sectionId; SavedNames[sectionName] = sectionId; } }