/// <summary> /// Begins the auto-detection. /// </summary> /// <param name="DetectionEvent">Callback function when the detection finished.</param> public void BeginDetection(DetectionCallback DetectionEvent) { DetectionDelegate detectdelegate = new DetectionDelegate(RunDetection); IAsyncResult result = detectdelegate.BeginInvoke( (r) => { var outcome = detectdelegate.EndInvoke(r); if (DetectionEvent != null) DetectionEvent(outcome); }, null); }
/// <summary> /// Begins the auto-detection. /// </summary> /// <param name="DetectionEvent">Callback function when the detection finished.</param> public void BeginDetection(DetectionCallback DetectionEvent) { DetectionDelegate detectdelegate = new DetectionDelegate(RunDetection); IAsyncResult result = detectdelegate.BeginInvoke( (r) => { var outcome = detectdelegate.EndInvoke(r); if (DetectionEvent != null) { DetectionEvent(outcome); } }, null); }
/// <summary>Initializes a new mouse reporter</summary> /// <param name="callback">Callback the reporter uses to report</param> /// <param name="playerIndex">Player index the reporter will report</param> public MouseButtonReporter( DetectionDelegate callback, ExtendedPlayerIndex? playerIndex ) : base(callback, playerIndex) { }
/// <summary>Initializes a new keyboard reporter</summary> /// <param name="callback">Callback the reporter uses to report</param> /// <param name="playerIndex">Player index the reporter will report</param> public KeyReporter( DetectionDelegate callback, ExtendedPlayerIndex? playerIndex ) : base(callback, playerIndex) { }
/// <summary>Initializes a new reporter</summary> /// <param name="callback">Callback the reporter uses to report</param> /// <param name="playerIndex">Player index the reporter will report</param> public Reporter(DetectionDelegate callback, ExtendedPlayerIndex? playerIndex) { this.Callback = callback; this.PlayerIndex = playerIndex; }
/// <summary>Initializes a new mouse reporter</summary> /// <param name="callback">Callback the reporter uses to report</param> /// <param name="playerIndex">Player index the reporter will report</param> public MouseButtonReporter( DetectionDelegate callback, ExtendedPlayerIndex?playerIndex ) : base(callback, playerIndex) { }
/// <summary>Initializes a new keyboard reporter</summary> /// <param name="callback">Callback the reporter uses to report</param> /// <param name="playerIndex">Player index the reporter will report</param> public KeyReporter( DetectionDelegate callback, ExtendedPlayerIndex?playerIndex ) : base(callback, playerIndex) { }
/// <summary>Initializes a new reporter</summary> /// <param name="callback">Callback the reporter uses to report</param> /// <param name="playerIndex">Player index the reporter will report</param> public Reporter(DetectionDelegate callback, ExtendedPlayerIndex?playerIndex) { this.Callback = callback; this.PlayerIndex = playerIndex; }