public void TestClear() { for (byte i = 0; i < 5; i++) { bindableStringByteDictionary.Add($"test{i}", i); } bindableStringByteDictionary.Clear(); Assert.IsEmpty(bindableStringByteDictionary); }
private void load() { IsConnected.BindValueChanged(connected => Schedule(() => { if (connected.NewValue) { // get all the users that were previously being watched int[] users = watchedUsers.ToArray(); watchedUsers.Clear(); // resubscribe to watched users. foreach (int userId in users) { WatchUser(userId); } // re-send state in case it wasn't received if (IsPlaying) { // TODO: this is likely sent out of order after a reconnect scenario. needs further consideration. BeginPlayingInternal(currentState); } } else { playingUsers.Clear(); watchedUserStates.Clear(); } }), true); }
private void load() { IsConnected.BindValueChanged(connected => Schedule(() => { if (connected.NewValue) { // get all the users that were previously being watched int[] users = watchingUsers.ToArray(); watchingUsers.Clear(); // resubscribe to watched users. foreach (int userId in users) { WatchUser(userId); } // re-send state in case it wasn't received if (IsPlaying) { BeginPlayingInternal(currentState); } } else { playingUsers.Clear(); playingUserStates.Clear(); } }), true); }