67 lines
1.2 KiB
Plaintext
67 lines
1.2 KiB
Plaintext
Type Worksheets = class
|
|
|
|
public
|
|
Function Create(object, name);
|
|
Function Init();
|
|
Function Operator[](index);
|
|
Function GetCollection();
|
|
|
|
private
|
|
xlsx_;
|
|
collection_;
|
|
|
|
public
|
|
Function Add();
|
|
Function Add2();
|
|
Function Copy();
|
|
Function Delete();
|
|
Function FillAcrossSheets();
|
|
Function Move();
|
|
Function PrintOut();
|
|
Function PrintPreview();
|
|
Function Select();
|
|
|
|
property worksheet read ReadWorksheet;
|
|
property Count read ReadCount;
|
|
Function ReadWorksheet(index);
|
|
Function ReadCount();
|
|
|
|
End;
|
|
|
|
// ============== 实现 ================= //
|
|
Function Worksheets.Create(object, name);
|
|
Begin
|
|
xlsx_ := object;
|
|
collection_ := class(Collection).GetInstance(name $ "worksheet");
|
|
collection_.SetIgnoreCase(true);
|
|
Init();
|
|
End;
|
|
|
|
Function Worksheets.Init();
|
|
Begin
|
|
sheets := xlsx_.GetSheets();
|
|
for k, v in sheets do
|
|
collection_.AddCollection(new Worksheet(xlsx_, v, collection_), v);
|
|
collection_.SetActivation(xlsx_.GetDefaultSheet());
|
|
End;
|
|
|
|
Function Operator Worksheets.[](index);
|
|
Begin
|
|
return collection_[index];
|
|
End;
|
|
|
|
Function Worksheets.ReadWorksheet(index);
|
|
Begin
|
|
return collection_[index];
|
|
End;
|
|
|
|
Function Worksheets.ReadCount();
|
|
Begin
|
|
return collection_.GetCount();
|
|
End;
|
|
|
|
Function Worksheets.GetCollection();
|
|
Begin
|
|
return collection_;
|
|
End;
|