Example #1
0
        /// <summary>
        /// returns the extern name if an valid ID is given!
        /// </summary>
        /// <param name="supIndex"></param>
        /// <param name="nameIndex"></param>
        /// <returns></returns>
        public String getExternNameByRef(UInt16 supIndex, UInt32 nameIndex)
        {
            ExternSheetData extSheet = this.externSheetDataList[supIndex];
            SupBookData     supData  = null;

            LinkedList <SupBookData> .Enumerator listenum = this.supBookDataList.GetEnumerator();

            String back     = "";
            int    count    = 0;
            int    counttwo = 0;

            listenum.MoveNext();
            do
            {
                if (count == extSheet.iSUPBOOK)
                {
                    supData = listenum.Current;
                }
                count++;
            }while (listenum.MoveNext());

            LinkedList <String> .Enumerator nameEnum = supData.ExternNames.GetEnumerator();
            do
            {
                if (counttwo == nameIndex)
                {
                    back = nameEnum.Current;
                }
                counttwo++;
            } while (nameEnum.MoveNext());


            return("[" + (supData.Number) + "]!" + back);
        }
Example #2
0
 /// <summary>
 /// Add the ExternSheetData extracted from an EXTERNSHEET BIFF Record
 /// </summary>
 /// <param name="ext">BIFF Record</param>
 public void addExternSheetData(ExternSheet ext)
 {
     for (int i = 0; i < ext.cXTI; i++)
     {
         ExternSheetData extdata = new ExternSheetData(ext.iSUPBOOK[i], ext.itabFirst[i], ext.itabLast[i]);
         this.externSheetDataList.Add(extdata);
     }
 }
Example #3
0
        /// <summary>
        /// Returns the string from an external workbook
        /// </summary>
        /// <param name="index">index from the workbook </param>
        /// <returns>Filename and sheetname </returns>
        public String getIXTIString(UInt16 index)
        {
            ExternSheetData extSheet = this.externSheetDataList[index];
            SupBookData     supData  = this.supBookDataList[extSheet.iSUPBOOK];

            //List<SupBookData>.Enumerator listenum = this.supBookDataList.GetEnumerator();

            //int count = 0;
            //listenum.MoveNext();
            //do
            //{
            //    if (count == extSheet.iSUPBOOK)
            //    {
            //        supData = listenum.Current;
            //    }
            //    count++;
            //}
            //while (listenum.MoveNext());

            String back = "";

            if (extSheet.itabFirst >= 0 && extSheet.itabLast >= 0 &&
                extSheet.itabFirst < this.boundSheetDataList.Count &&
                extSheet.itabLast < this.boundSheetDataList.Count)
            {
                if (supData != null && supData.SelfRef)
                {
                    String first = this.boundSheetDataList[extSheet.itabFirst].boundsheetRecord.stName.Value;
                    String last  = this.boundSheetDataList[extSheet.itabLast].boundsheetRecord.stName.Value;
                    if (first.Equals(last))
                    {
                        back = first;
                    }
                    else
                    {
                        back = first + ":" + last;
                    }
                }
                else
                {
                    String first = supData.getRgstString(extSheet.itabFirst);
                    String last  = supData.getRgstString(extSheet.itabLast);
                    if (first.Equals(last))
                    {
                        back = first;
                    }
                    else
                    {
                        back = first + ":" + last;
                    }
                    // add one to the index
                    back = "[" + supData.Number.ToString() + "]" + back;
                }
            }
            return(back);
        }
Example #4
0
        /// <summary>
        /// returns the extern name if an valid ID is given!
        /// </summary>
        /// <param name="supIndex"></param>
        /// <param name="nameIndex"></param>
        /// <returns></returns>
        public String getExternNameByRef(UInt16 supIndex, UInt32 nameIndex)
        {
            ExternSheetData extSheet = this.externSheetDataList[supIndex];
            SupBookData     supData  = this.supBookDataList[extSheet.iSUPBOOK];

            String back = "";
            //List<SupBookData>.Enumerator listenum = this.supBookDataList.GetEnumerator();
            //int count = 0;
            int counttwo = 0;

            //listenum.MoveNext();
            //do
            //{
            //    if (count == extSheet.iSUPBOOK)
            //    {
            //        supData = listenum.Current;
            //    }
            //    count++;
            //}
            //while (listenum.MoveNext());
            //if (supData.SelfRef)
            //{
            //    back = this.definedNameList[(int)nameIndex - 1].Name.Value;
            //}
            //else
            //{
            LinkedList <String> .Enumerator nameEnum = supData.ExternNames.GetEnumerator();
            do
            {
                if (counttwo == nameIndex)
                {
                    back = nameEnum.Current;
                }
                counttwo++;
            } while (nameEnum.MoveNext());
            //}


            return("[" + (supData.Number) + "]!" + back);
        }