I'm looking to write C# simple statement using static bool which return true the first time, then always false.
static bool _firstTime = true;
static bool FirstTime
{
get
{
bool old = _firstTime;
_firstTime = false;
return old;
}
}
This works, but i'm looking for something shorter without temporary variable (here "old").
Thanks.