Пример #1
0
 internal TBoundSheetList()
 {
     FSheetNames  = new TSheetNameList();
     FBoundSheets = new TBoundSheetRecordList();
     FTabList     = new UInt32List();
     MaxTabId     = 0;
 }
Пример #2
0
        internal void Add(TBoundSheetRecordList BoundSheets, int SheetToInsert, string aName, int SheetPos) //Error if duplicated entry
        {
            if (FList.ContainsKey(aName))
            {
                XlsMessages.ThrowException(XlsErr.ErrDuplicatedSheetName, aName);
            }
            FixSheetPos(BoundSheets, SheetToInsert, 1);

            FList.Add(aName, SheetPos);
        }
Пример #3
0
 private void FixSheetPos(TBoundSheetRecordList BoundSheets, int FirstSheet, int p)
 {
     if (BoundSheets == null)
     {
         return;
     }
     for (int i = FirstSheet; i < BoundSheets.Count; i++)
     {
         string key = BoundSheets[i].SheetName;
         FList[key] += p;
     }
 }
Пример #4
0
        internal string AddUniqueName(TBoundSheetRecordList BoundSheets, int SheetToInsert, string aName, int SheetPos)
        {
            int    n = FList.Count + 1;
            string NewName;

            do
            {
                NewName = aName + n.ToString(CultureInfo.InvariantCulture);
                n++;
            } while (FList.ContainsKey(NewName));

            Add(BoundSheets, SheetToInsert, NewName, SheetPos);
            return(NewName);
        }
Пример #5
0
 internal void DeleteSheet(string SheetName, TBoundSheetRecordList BoundSheets, int SheetToDelete)
 {
     FList.Remove(SheetName);
     FixSheetPos(BoundSheets, SheetToDelete + 1, -1);
 }