示例#1
0
        internal void   Init(InstanceOffset[] offsets, int[] shifts)
        {
            RejectResult();
            LastSection = "";
            LastSectionRestartsOffset = 0;
//            Shifts = shifts;
//            Offsets = offsets;
            SectionStartOffset.Clear();
            _sectionBorders.Clear();
            SavedNames.Clear();
        }
示例#2
0
 //--------------------------------------------------------------------
 #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]);
 }
示例#3
0
        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;
            }
        }