Example #1
0
        ///       <summary>
        ///       The method creates a map of file name and a list of the pages that it contains
        ///       and saves it in the global constants.
        ///       </summary>
        public void createFilePageMap()
        {
            Dictionary <string, List <string> > filePageMap = new Dictionary <string, List <string> >();

            if (CurrentDCO.ObjectType() == Constants.Batch)
            {
                for (int i = 0; i < CurrentDCO.NumOfChildren(); i++)
                {
                    TDCOLib.IDCO childDCO = CurrentDCO.GetChild(i);
                    if (childDCO.ObjectType() == Constants.Page)
                    {
                        SmartNav.SetRRCurrentDCO(childDCO);
                        string        imageName = SmartNav.MetaWord(Constants.SMARTP_AT + "P.ScanSrcPath");
                        List <string> pages     = null;
                        if (filePageMap.ContainsKey(imageName))
                        {
                            pages = filePageMap[imageName];
                        }
                        else
                        {
                            pages = new List <string>();
                        }
                        pages.Add(childDCO.ID);
                        filePageMap[imageName] = pages;
                        ExportCore.WriteInfoLog(" file page map   " + imageName + " : " + childDCO.ID + "; size : " + pages.Count);
                    }
                }
                Globals.Instance.SetData(Constants.FILE_PAGE_MAP, filePageMap);
                SmartNav.SetRRCurrentDCO(CurrentDCO);
            }
            else
            {
                throw new SmartExportException("Unable to create File-Page map, since the associated level is not  Batch.");
            }
        }