public SeqCtrlUse2 CompSeqCtrl2(ShtCompTypes type, int compListIdx)
 {
     return(ShtCompList2[(int)type].ShtCompInfo[compListIdx].SeqCtrlUse);
 }
 public bool CompIsUsed2(ShtCompTypes type, int compListIdx)
 {
     return(ShtCompList2[(int)type].ShtCompInfo[compListIdx].IsUsed);
 }
 public int CompValueIdx2(ShtCompTypes type, int compListIdx)
 {
     return(ShtCompList2[(int)type].ShtCompInfo[compListIdx].ValueIndex);
 }
 public string CompTitle2(ShtCompTypes type, int compListIdx)
 {
     return(ShtCompList2[(int)type].ShtCompInfo[compListIdx].Title);
 }
 public string CompGrpName2(ShtCompTypes type, int compListIdx)
 {
     return(ShtCompList2[(int)type].ShtCompInfo[compListIdx].GrpName);
 }
Example #6
0
        internal bool ParseType(ShtCompTypes type, GroupCollection g, FileNameSheetPdf shtIdComps)
        {
            string test;

            bool?use      = null;         // false is optional & true is required
            bool hasPrior = false;
            bool inOptSeq = false;

            foreach (SheetCompInfo2 ci in ShtIds.ShtCompList2[(int)type].ShtCompInfo)
            {
                if (!ci.IsUseOK)
                {
                    return(false);
                }

                if (ci.SeqCtrlUse == SeqCtrlUse2.SKIP ||
                    ci.SeqCtrlUse == SeqCtrlUse2.NOT_USED)
                {
                    continue;
                }

                if (ci.SeqCtrlUse == SeqCtrlUse2.OPTIONAL)
                {
                    use = false;
                }
                else if (ci.SeqCtrlUse == SeqCtrlUse2.REQUIRED)
                {
                    use = true;
                }

                if (inOptSeq)
                {
                    if (ci.GetNextOpt() == SeqCtrlNextOpt.SEQ_END)
                    {
                        inOptSeq = false;
                    }

                    continue;
                }

                test = g[ci.GrpName].Value;

                if (use == true)
                {
                    // required
                    if (!ci.IsReqdProceedOK || !ci.IsReqdNextOK)
                    {
                        return(false);
                    }

                    if (test.IsVoid())
                    {
                        return(false);
                    }
                }
                else
                {
                    if (!ci.IsOptProceedOK || !ci.IsOptNextOK)
                    {
                        return(false);
                    }

                    // optional
                    if (test.IsVoid())
                    {
                        // no test value
                        if (ci.GetNextOpt() == SeqCtrlNextOpt.SEQ_END_SEQ_REQ)
                        {
                            return(false);
                        }
                        if (hasPrior && ci.GetNextOpt() == SeqCtrlNextOpt.REQ_IF_PRIOR)
                        {
                            return(false);
                        }

                        if (ci.GetNextOpt() == SeqCtrlNextOpt.SEQ_START)
                        {
                            inOptSeq = true;
                        }

                        hasPrior = false;
                        continue;
                    }

                    // not void - has a test value

                    if (ci.GetNextOpt() == SeqCtrlNextOpt.SEQ_END_SEQ_REQ)
                    {
                        inOptSeq = false;
                    }
                }

                shtIdComps.SheetComps[ci.ValueIndex] = test;

                hasPrior = true;

                if (ci.GetProceedOpt() == SeqCtrlProceedOpt.END ||
                    ci.GetProceedReqd() == SeqCtrlProceedReqd.END)
                {
                    break;
                }
            }

            return(true);
        }