Esempio n. 1
0
        private static Ptg CreateDeletedRef(Ptg ptg)
        {
            if (ptg is RefPtg)
            {
                return new RefErrorPtg();
            }
            if (ptg is Ref3DPtg)
            {
                Ref3DPtg rptg = (Ref3DPtg)ptg;
                return new DeletedRef3DPtg(rptg.ExternSheetIndex);
            }
            if (ptg is AreaPtg)
            {
                return new AreaErrPtg();
            }
            if (ptg is Area3DPtg)
            {
                Area3DPtg area3DPtg = (Area3DPtg)ptg;
                return new DeletedArea3DPtg(area3DPtg.ExternSheetIndex);
            }

            throw new ArgumentException("Unexpected ref ptg class (" + ptg.GetType().Name + ")");
        }
Esempio n. 2
0
 private static Double ConvertArrayNumber(Ptg ptg, bool isPositive)
 {
     double value;
     if (ptg is IntPtg)
     {
         value = ((IntPtg)ptg).Value;
     }
     else if (ptg is NumberPtg)
     {
         value = ((NumberPtg)ptg).Value;
     }
     else
     {
         throw new Exception("Unexpected ptg (" + ptg.GetType().Name + ")");
     }
     if (!isPositive)
     {
         value = -value;
     }
     return value;
 }