public RadioController() { _radio = new Radio(); _radio.ScanUpdated += (s, e) => ScanUpdated?.Invoke(this, new ScanUpdatedEventArgs(e.Frequency)); _radio.ScanCompleted += (s, e) => ScanCompleted?.Invoke(this, EventArgs.Empty); }
private void OnPathfinderScanCompleted() { foreach (var cell in Cells) { cell.IsWalkable = Pathfinder.Instance.IsPointWalkable(cell.transform.position); } ScanCompleted?.Invoke(); }
/// <summary> /// Raises the ItemScanCompleted event. /// </summary> /// <param name="e"></param> protected void OnItemScanCompleted(ScanCompletedArgs e) { ScanCompleted completed = ItemScanCompleted; if (completed != null) { completed(e); } }
public Task Handle(ScanCompleted message, IMessageHandlerContext context) { // log.Info($"Handling: ImageStored for Image Id: {message.ImageGuid}"); string methodID = string.Empty; ScanCompletedEvent(methodID); return(Task.CompletedTask); }
private void InitCallbacks() { _scanCompletedCallback = _ => ScanCompleted?.Invoke(this, EventArgs.Empty); _interruptedCallback = (reason, _) => Interrupted?.Invoke(this, new RadioInterruptedEventArgs(reason)); _scanUpdatedCallback = (frequency, _) => ScanUpdated?.Invoke(this, new ScanUpdatedEventArgs(frequency)); _scanStoppedCallback = _ => ScanStopped?.Invoke(this, EventArgs.Empty); }
void bgw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { ScanCompleteEvent args = new ScanCompleteEvent(); args.EndFrequency = _endFreq; args.StartFrequency = _startFreq; args.MinSignalStrength = _minStrength; args.PeakDictionary = PeakDictionary; args.passes = Passes; if (e.Result != null && e.Result is Exception) { args.Error = e.Result as Exception; args.EndFrequency = 0; Debug.WriteLine("Scan interrupted by exception. Firing Event."); Debug.WriteLine("Exception details: " + args.Error.Message + Environment.NewLine + args.Error.StackTrace); } else { Debug.WriteLine("Scan complete. Firing Event."); } StringBuilder sb = new StringBuilder(); #if DEBUG foreach (KeyValuePair <MicrowaveTuning, MicrowaveLinkQuality> fr in PeakDictionary) { sb.AppendLine("Freq: " + fr.Key.FrequencyMHz + " Strength: " + fr.Value.ReceivedCarrierLevel); } Debug.WriteLine(sb.ToString()); #endif if (this.ScanCompleted != null) { ScanCompleted.Invoke(this, args); } inSearch = false; }
public void Scan() { this.pathfinder.Scan(); ScanCompleted?.Invoke(); }
private static void _bgw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { ScanCompleted?.Invoke(null, e); }
protected void OnScanCompleted(int[] Value) => ScanCompleted?.Invoke(Value);