private void btnHome_Click(object sender, EventArgs e) { if (btnHome.Text.ToUpper() == "START") { SetButtonFocus(btnHome, "STOP"); _L2RPacketLogger.StartCapture(); } else { SetButtonFocus(btnHome, "START"); _L2RPacketLogger.StopCapture(); } }
public PacketService(L2RPacketService L2RPacketLogger, //DI should inject my Singleton instance here BountyService BountyService, SurveyService FortService, PlayerService PlayerService, KillService KillService, DiscordSocketClient Discord, IConfiguration config) { _L2RPacketLogger = L2RPacketLogger; _discord = Discord; _bountyService = BountyService; _fortService = FortService; _playerService = PlayerService; _killService = KillService; _config = config; _L2RPacketLogger.L2RPacketArrivalEvent += OnL2RPacketArrival; _L2RPacketLogger.StartCapture(InitializeDevice()); }
private void frmHome_Load(object sender, EventArgs e) { _L2RPacketLogger.L2RPacketArrivalEvent += OnL2RPacketArrival; _L2RPacketLogger.StartCapture(); }