[c#] C# Wait until condition is true