FreeLimitReachedAction Enumeration |
Namespace: GemBox.Spreadsheet
Member name | Value | Description | |
---|---|---|---|
ThrowException | 0 | Throw FreeLimitReachedException. | |
Stop | 1 | Stop reading/writing. | |
ContinueAsTrial | 2 | Continue reading/writing using trial mode. |
Following code demonstrates one way of testing performances of GemBox.Spreadsheet.
SpreadsheetInfo.SetLicense("FREE-LIMITED-KEY"); SpreadsheetInfo.FreeLimitReached += (sender, e) => e.FreeLimitReachedAction = FreeLimitReachedAction.ContinueAsTrial; Stopwatch sw = new Stopwatch(); sw.Start(); ExcelFile ef = ExcelFile.Load(fileName); sw.Stop(); Console.WriteLine("Load time: " + sw.Elapsed.TotalSeconds + " seconds."); sw.Reset(); sw.Start(); int cellWithValueCount = 0; foreach (var sheet in ef.Worksheets) foreach (var row in sheet.Rows) foreach (var cell in row.AllocatedCells) if (cell.Value != null) ++cellWithValueCount; sw.Stop(); Console.WriteLine("Iterate through all used cells time: " + sw.Elapsed.TotalSeconds + " seconds. Cells with value: " + cellWithValueCount); sw.Reset(); sw.Start(); ef.Save(fileName); sw.Stop(); Console.WriteLine("Save time: " + sw.Elapsed.TotalSeconds + " seconds.");