Click or drag to resize
FreeLimitReachedAction Enumeration
Type of action that can be chosen when free limit is reached.

Namespace:  GemBox.Spreadsheet
Assembly:  GemBox.Spreadsheet (in GemBox.Spreadsheet.dll) Version: 41.3.30.1032
Syntax
public enum FreeLimitReachedAction
Members
  Member nameValueDescription
ThrowException0 Throw FreeLimitReachedException.
Stop1 Stop reading/writing.
ContinueAsTrial2 Continue reading/writing using trial mode.
Examples

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.");
See Also