void _graphControlClient_ChannelScanProgressUpdate(object sender, EventArgs e) { if (ChannelScanProgressUpdate != null) { ChannelScanProgressUpdate.Invoke(this, e); } }
internal void FireChannelScanProgressUpdated(int progress) { if (this.ChannelScanProgress < 0) { if (ChannelScanStarted != null) { ChannelScanStarted.Invoke(this, new EventArgs()); } } this.ChannelScanProgress = progress; if (ChannelScanProgressUpdate != null) { ChannelScanProgressUpdate.Invoke(this, new EventArgs()); } }
private void Timer_Tick(object sender, EventArgs e) { _timer.Enabled = false; int str = _baseTuner.GetSignalStrength(); Debug.WriteLine("Channel " + _current.ToString() + " Str: " + str.ToString()); if (str != 0) { Channel actual = _baseTuner.TryChannel; if (actual != null) { Debug.WriteLine("actually found channel: " + actual.ToDebugString()); if (_virtualChannelTuner != null) { List <Channel> virtualChannels = _virtualChannelTuner.GetVirtualChannels(); foreach (Channel ch in virtualChannels) { _channelList.Add(ch); } } else { _channelList.Add(actual); } _channelList.DumpToDebug(); } } if (Current.Equals(_max)) { Stop(); _baseTuner.KnownChannels = this.FoundChannels; if (_baseTuner.KnownChannels.Count > 0) { _baseTuner.Channel = _baseTuner.KnownChannels.Items[0]; } if (ChannelScanComplete != null) { ChannelScanComplete.Invoke(this, new ChannelScanCompleteEventArgs(_channelList.Count)); } } else { Current = new Channel(Current.PhysicalChannel + 1); _baseTuner.TryChannel = Current; curChannelCount++; if (ChannelScanProgressUpdate != null) { this.ChannelScanProgress = (int)(((double)curChannelCount / (double)totalChannels) * 100.0); ChannelScanProgressUpdate.Invoke(this, new EventArgs()); } if (!_channelScanCancelled) { _timer.Enabled = true; } } }