/// <summary> /// 支持异步方式发出修改通知时间。 /// </summary> /// <param name="addType"></param> protected void AddChangedType(ViPouSourceCPU.CPUInfoChangedType addType) { if (this.changedType == ViPouSourceCPU.CPUInfoChangedType.None) { this.changedType = addType; this.Dispatcher.BeginInvoke(new Action(() => { if (this.CPUInfoChanged != null) { this.CPUInfoChanged.Invoke(this, this.changedType); } this.changedType = ViPouSourceCPU.CPUInfoChangedType.None; }), DispatcherPriority.ApplicationIdle); } else { this.changedType |= addType; } }
void cpu_CPUInfoChanged(object sender, ViPouSourceCPU.CPUInfoChangedType changedType) { // 强制刷新 CPU 信息 this.CPU = this.cpu; }