private void Variable_Connected(object sender, PviEventArgs e) { var variable = sender as Variable; var cpu = variable.Parent as Cpu; if (variable != null && cpu != null) { _logger.Log(new LogEntry(LoggingEventType.Information, PviMessage.FormatMessage($"Variable Connected. Cpu={cpu.Name}; Variable={variable.Name}", e))); } }
private void cpu_Connected(object sender, PviEventArgs e) { Cpu cpu = sender as Cpu; if (cpu != null) { UpdateLoaded(e.Name); } _logger.Log(new LogEntry(LoggingEventType.Information, PviMessage.FormatMessage("Cpu Connected", e))); }
private void cpu_Error(object sender, PviEventArgs e) { _logger.Log(new LogEntry(LoggingEventType.Information, PviMessage.FormatMessage("Cpu Error", e))); Cpu cpu = sender as Cpu; if (cpu != null) { cpu.Connected -= cpu_Connected; cpu.Error -= cpu_Error; cpu.Disconnected -= cpu_Disconnected; UpdateLoaded(e.Name); } }