public void Logout() { _store.SetSession(null); currentSession = null; OnLogout?.Invoke(this, EventArgs.Empty); SessionChanged?.Invoke(this, EventArgs.Empty); }
public void SetSession(Session session) { if (session == CurrentSession) { return; } SessionChanged?.Invoke(this, session); Content.Reset(); // clear all fragments & chunks cache if (CurrentSession != null) { CurrentSession.Storage.BlockIterator.ClearCache(); CurrentSession.StorageDataChanged -= StorageDataChanged;; CurrentSession.ViewContent = Content; // backup state } CurrentSession = session; CurrentSession.StorageDataChanged += StorageDataChanged; if (CurrentSession.ViewContent is FragmentViewContent viewContent) { Content = viewContent; // restore state } else { CreateContent(); // new session } Mouse.IsSelecting = false; // reset ongoing selection InvalidateMeasure(); // rebuild all fragments }
protected override void Consume([NotNull] SessionChangedEvent @event) { if (@event == null) { throw new ArgumentNullException(nameof(@event)); } SessionChanged?.Invoke(this, @event.SessionId); }
public void AddIncomingLetter(Letter letter) { var dialog = GetDialogById(letter.FromId); if (dialog != null) { dialog.Chat += "<< " + letter.Message + "\n"; SessionChanged?.Invoke(Dialogs); } }
public void AddOutgoingLetter(Letter letter) // TODO: почти одинаковый метод с AddIncomingLetter! { var dialog = GetDialogById(letter.ToId); if (dialog != null) { dialog.Chat += ">> " + letter.Message + "\n"; SessionChanged?.Invoke(Dialogs); } }
public void SetCurrentSession(IApi api) { ; currentSession = api; if (api != null) { _store.SetSession(api.GetSessionInfo()); } SessionChanged?.Invoke(this, EventArgs.Empty); OnLogin?.Invoke(this, EventArgs.Empty); SessionChanged?.Invoke(this, EventArgs.Empty); }
public virtual void Attach(ConsoleSession session) { if (session == Session) { return; } var oldSession = Session; Session = null; oldSession?.RemoveClient(this); this.Session = session; Session?.AddClient(this); SessionChanged?.Invoke(this); }
public void HandleNetworkEven(UserNetworkEvent netEvent) { switch (netEvent.NetworkEvent) { case NetworkEvent.Connect: TryCreateNewDialog(netEvent.Id, netEvent.Name); break; case NetworkEvent.Leave: RemoveDialog(netEvent.Id); break; } SessionChanged?.Invoke(Dialogs); }
/// <summary> /// Called by UnityEngine when a broadcast is received. /// </summary> /// <param name="fromAddress">When the broadcast came from</param> /// <param name="data">The data in the broad cast. Not currently used, but could /// be used for differentiating rooms or similar.</param> public void receivedBroadcast(string fromAddress, string data) { Debug.Log(fromAddress); Debug.Log(data); string serverIp = fromAddress.Substring(fromAddress.LastIndexOf(':') + 1); sessions_ = new SessionInfo() { ip = serverIp, name = data }; if (SessionChanged != null) { SessionChanged.Invoke(); } }
public void DestroySession(String sessionID) { try { lock (rfcThreads) { if (rfcThreads.Remove(sessionID)) { // Send the event to the RfcSessionManager: SessionChanged?.Invoke(new RfcSessionEventArgs(RfcSessionManager.EventType.DESTROYED, sessionID)); } } } catch (Exception ex) { //My.Application.Log.WriteException(ex); } }
private void OnSessionNotify(ICallSession session) { SessionChanged?.Invoke(session); switch (session.State) { case CallState.Idle: session.Notify -= OnSessionNotify; try { _sessions.TryRemove(session.Id, out _); _container.Release(session.RouteId); } finally { session.Dispose(); } break; default: break; } }
protected void OnSessionChanged(object data) { SessionChanged?.Invoke(this, new SessionStatusArgs(data)); }
private void SendStateChange() { SessionChanged?.Invoke(this, new SessionEventArgs(_sessionState)); }
private void OnSessionChanged(PacketReceivedEventArgs <PacketSessionData> e) { SessionChanged?.Invoke(this, e); }
private void OnSessionChanged(IEnumerable <Change> changes) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SessionSerialized")); SessionChanged?.Invoke(this, new EventArgs <IEnumerable <Change> >(changes)); }
protected void OnSessionChanged(AgentSessionBase session) { SessionChanged?.Invoke(this, new SessionStateEventArgs(session)); }
/// <summary> /// Called when the value of the <see cref="Session"/> property has changed. /// </summary> /// <remarks> /// When the manager is first created, the value of <see cref="Session"/> /// will be <see langword = "null" />. Various operations of the manager /// can cause sessions to be created or replaced. This event will fire /// whenever the value of the <see cref="Session"/> property has changed. /// </remarks> protected virtual void OnSessionChanged() { SessionChanged?.Invoke(this, EventArgs.Empty); }
public static void FireSessionChangedEvent(SessionChangedEventArgs args) { SessionChanged?.Invoke(args); }