-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from Olaren15/skip-caching-option
Added option to skip caching when enumerating rows
- Loading branch information
Showing
2 changed files
with
46 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
|
||
namespace Lumina.Excel | ||
{ | ||
/// <summary> | ||
/// Class that allows to skip the caching of Excel rows when they are read. | ||
/// </summary> | ||
public sealed class NoCache : IDisposable | ||
{ | ||
[field: ThreadStatic] | ||
internal static bool IsEnabled { get; private set; } | ||
|
||
/// <summary> | ||
/// Disables the caching of Excel rows when they are read. | ||
/// </summary> | ||
public NoCache() | ||
{ | ||
IsEnabled = true; | ||
} | ||
|
||
/// <summary> | ||
/// Re-enables the caching of Excel rows when they are read. | ||
/// </summary> | ||
public void Dispose() | ||
{ | ||
IsEnabled = false; | ||
} | ||
} | ||
} |