コード例 #1
0
        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)));
            }
        }
コード例 #2
0
        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)));
        }
コード例 #3
0
        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);
            }
        }