Skip to content

Instantly share code, notes, and snippets.

@Blecki
Created April 16, 2015 01:53
Show Gist options
  • Save Blecki/024c3deae40da5b7a396 to your computer and use it in GitHub Desktop.
Save Blecki/024c3deae40da5b7a396 to your computer and use it in GitHub Desktop.
class Whatever
{
private class StaticBool { public bool Value = false; }
public RuleBuilder<T0, T1, TR> FirstTimeOnly()
{
var fakeStatic = new StaticBool();
return this.When((P0, P1) =>
{
if (fakeStatic.Value) return false;
fakeStatic.Value = true;
return true;
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment