public override void SessionCompleted(Session ssn, SessionCompleted cmp) { RangeSet ranges = cmp.GetCommands(); RangeSet known = null; if (cmp.GetTimelyReply()) { known = new RangeSet(); } if (ranges != null) { foreach (Range range in ranges) { bool advanced = ssn.Complete(range.Lower, range.Upper); if (advanced && known != null) { known.Add(range); } } } if (known != null) { ssn.SessionKnownCompleted(known); } }
public void RegisterKeyPress(string text) { foreach (var c in text) { RegisterKeyPressForChar(c); } void RegisterKeyPressForChar(char c) { if (StartTime is null) { StartTime = DateTime.UtcNow; } if (Position < CharactersToType.Count) { CharactersToType[Position].RegisterEntry(c); if (CharactersToType[Position].WasCharacterMistyped) { Mistypes++; } Position++; if (Position == CharactersToType.Count) { EndTime = DateTime.UtcNow; SessionCompleted?.Invoke(this, EventArgs.Empty); } } } }
public void InputSequence(bool b) { PlaySound(b); if (sequence[playIndex] == b) { if (playIndex >= sequence.Count - 1) { score++; StartPlayBack(); return; } playIndex++; } else { soundPlayer.Stop(); buttonOne.Visible = buttonZero.Visible = false; CheckHighScore(); SessionCompleted?.Invoke(this, SequenceString); } }
/// <summary> /// Raises the SessionCompleted Event. /// </summary> /// <param name="args">The event data.</param> protected internal virtual void OnSessionCompleted(SessionEventArgs args) { SessionCompleted?.Invoke(this, args); }
private void Server_OnSessionCompleted(object sender, SessionEventArgs e) { // Trigger the Session Created event for the Listener SessionCompleted?.Invoke(sender, e); }
public void OnSessionCompleted(IConnection connection, ISession session) { SessionCompleted?.Invoke(this, new SessionEventArgs(session)); }
public virtual void SessionCompleted(C context, SessionCompleted mystruct) { }
protected virtual void OnSessionCompleted(CtpNetStream token) { SessionCompleted?.Invoke(token); }