/// <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); }
/// <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); }
/// <summary> /// Add a SUPBOOK BIFF Record to the list /// </summary> /// <param name="sup"></param> public void addSupBookData(SupBook sup) { SupBookData supbook = new SupBookData(sup); if (!supbook.SelfRef) { this.refWorkBookNumber++; supbook.Number = this.refWorkBookNumber; } this.supBookDataList.Add(supbook); }
/// <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); }