Esempio n. 1
0
        public override Object Clone()
        {
            LinkedDataRecord rec = new LinkedDataRecord();

            rec.field_1_linkType             = field_1_linkType;
            rec.field_2_referenceType        = field_2_referenceType;
            rec.field_3_options              = field_3_options;
            rec.field_4_indexNumberFmtRecord = field_4_indexNumberFmtRecord;
            rec.field_5_formulaOfLink        = field_5_formulaOfLink.Copy();
            return(rec);
        }
        public override Object Clone()
        {
            LinkedDataRecord rec = new LinkedDataRecord();

            rec.field_1_linkType = field_1_linkType;
            rec.field_2_referenceType = field_2_referenceType;
            rec.field_3_options = field_3_options;
            rec.field_4_indexNumberFmtRecord = field_4_indexNumberFmtRecord;
            rec.field_5_formulaOfLink = field_5_formulaOfLink.Copy();
            return rec;
        }
Esempio n. 3
0
 private LinkedDataRecord CreateTitleLinkedDataRecord()
 {
     LinkedDataRecord r = new LinkedDataRecord();
     r.LinkType = (LinkedDataRecord.LINK_TYPE_TITLE_OR_TEXT);
     r.ReferenceType = (LinkedDataRecord.REFERENCE_TYPE_DIRECT);
     r.IsCustomNumberFormat = (false);
     r.IndexNumberFmtRecord = ((short)0);
     r.FormulaOfLink = (null);
     return r;
 }
Esempio n. 4
0
 private LinkedDataRecord CreateValuesLinkedDataRecord()
 {
     LinkedDataRecord r = new LinkedDataRecord();
     r.LinkType = (LinkedDataRecord.LINK_TYPE_VALUES);
     r.ReferenceType = (LinkedDataRecord.REFERENCE_TYPE_WORKSHEET);
     r.IsCustomNumberFormat = (false);
     r.IndexNumberFmtRecord = ((short)0);
     Area3DPtg p = new Area3DPtg(0, 31, 0, 0,
             false, false, false, false, 0);
     r.FormulaOfLink = (new Ptg[] { p, });
     return r;
 }
Esempio n. 5
0
            private int SetVerticalCellRange(LinkedDataRecord linkedDataRecord,
                                                 CellRangeAddressBase range)
            {
                if (linkedDataRecord == null)
                {
                    throw new ArgumentNullException("linkedDataRecord should not be null"); ;
                }

                List<Ptg> ptgList = new List<Ptg>();

                int rowCount = (range.LastRow - range.FirstRow) + 1;
                int colCount = (range.LastColumn - range.FirstColumn) + 1;

                foreach (Ptg ptg in linkedDataRecord.FormulaOfLink)
                {
                    if (ptg is AreaPtgBase)
                    {
                        AreaPtgBase areaPtg = (AreaPtgBase)ptg;

                        areaPtg.FirstRow = range.FirstRow;
                        areaPtg.LastRow = range.LastRow;

                        areaPtg.FirstColumn = range.FirstColumn;
                        areaPtg.LastColumn = range.LastColumn;
                        ptgList.Add(areaPtg);
                    }
                }

                linkedDataRecord.FormulaOfLink = (ptgList.ToArray());

                return rowCount * colCount;
            }
Esempio n. 6
0
            private CellRangeAddressBase GetCellRange(LinkedDataRecord linkedDataRecord)
            {
                if (linkedDataRecord == null)
                {
                    return null;
                }

                int firstRow = 0;
                int lastRow = 0;
                int firstCol = 0;
                int lastCol = 0;

                foreach (Ptg ptg in linkedDataRecord.FormulaOfLink)
                {
                    if (ptg is AreaPtgBase)
                    {
                        AreaPtgBase areaPtg = (AreaPtgBase)ptg;

                        firstRow = areaPtg.FirstRow;
                        lastRow = areaPtg.LastRow;

                        firstCol = areaPtg.FirstColumn;
                        lastCol = areaPtg.LastColumn;
                    }
                }

                return new CellRangeAddress(firstRow, lastRow, firstCol, lastCol);
            }
Esempio n. 7
0
 internal void InsertData(LinkedDataRecord data)
 {
     switch (data.LinkType)
     {
         case 0: dataName = data;
             break;
         case 1: dataValues = data;
             break;
         case 2: dataCategoryLabels = data;
             break;
         case 3: dataSecondaryCategoryLabels = data;
             break;
     }
 }