public void SetCurrent(ExtendedTox tox) { _toxAv?.Dispose(); _toxAv = new ToxAv(tox); RegisterHandlers(); }
public void SetCurrent(ExtendedTox tox) { if (_toxAv != null) { _toxAv.Dispose(); } _toxAv = new ToxAv(tox); RegisterHandlers(); }
private ToxModel() { var tox = new ExtendedTox(new ToxOptions(true, true)) { Name = "User", StatusMessage = "Using OneTox." }; SetCurrent(tox); _semaphore = new SemaphoreSlim(1); _lastConnectionStatusRegistry = new LastConnectionStatusRegistry(); }
/// <summary> /// Replaces the current underlying EntededTox instance with a new one. /// It's used for profile switching. /// </summary> /// <param name="tox">The new ExtendedTox instance.</param> public void SetCurrent(ExtendedTox tox) { ToxAvModel.Instance.SetCurrent(tox); if (_tox != null) { _tox.Dispose(); } _tox = tox; RegisterHandlers(); RaiseAllPropertiesChanged(); RaiseFriendListReseted(); }