示例#1
0
 /// <summary>
 /// List<Form> Init(int toc_line) - initiate all Forms for Document in toc_line.
 /// </summary>
 /// <param name="toc_line">line number in TOC</param>
 /// <returns>form list</returns>
 public static List<Form> Init(int toc_line)
 {
     Log.set("Init(" + toc_line + ")");
     //------------------------------------------------------------------------------
     language = true; //en-US for Englisg Debug. Remove or comment this line later  !
     //------------------------------------------------------------------------------
     List<Form> Forms = new List<Form>();
     for (int col = Decl.DOC_FORMS, i = 0; i < 10; i++)
     {
         string s = Lang(tocMtr.Strng(toc_line, col++));
         if (string.IsNullOrEmpty(s)) continue;
         if (FileOp.isNamedRangeExist(Wb, s))
         {
             List<int> _r = new List<int>();
             List<int> _c = new List<int>();
             string sf = s + "_F";
             if (FileOp.isNamedRangeExist(Wb, sf))
             {
                 Mtr format = new Mtr(Wb.Names.Item(sf).RefersToRange.Value);
                 for (int c = 1; c <= format.iEOC(); c++)
                     for (int r = 1; r <= format.iEOL(); r++)
                     {
                         string f = format.Strng(r, c);
                         if (f.Contains("{") & f.Contains("}")) { _r.Add(r); _c.Add(c); }
                     }
             }
             Forms.Add(new Form(s, _r, _c));
         }
     }
     Log.exit();
     return Forms;
 }