private void onTerminalEvent(TerminalEventArgs e) { if (TerminalEvent != null) { TerminalEvent(this, e); } }
protected void onConnected() { if (TerminalEvent != null) { TerminalEventArgs e = new TerminalEventArgs(); e.EventType = EventTypeCodes.Connected; TerminalEvent(this, e); } }
protected void onDisconnected(string DisconnectMessage) { if (TerminalEvent != null) { TerminalEventArgs e = new TerminalEventArgs(); e.EventType = EventTypeCodes.Disconnected; TerminalEvent(this, e); } }
protected void onTerminalEvent(EventTypeCodes EventType, string Message) { if (TerminalEvent != null) { TerminalEventArgs e = new TerminalEventArgs(); e.EventType = EventType; e.Message = Message; TerminalEvent(this, e); } }
private void Client_CentralCommand(object sender, TerminalEventArgs args) { try { this.BeginInvoke(new RunControllerProcess(RunCommand), args); } catch (Exception e) { MessageBox.Show(e.Message); } }
/// <summary> /// Оповещение о входящем вызове /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private static void Phone_Ringing(ITerminal sender, TerminalEventArgs e) { Console.WriteLine($"{sender.Name}: {e.Message}"); Console.WriteLine($"Ответить - 1, Сбросить - любая клавиша"); int command = int.Parse(Console.ReadLine()); bool answer = false; if (command == 1) { answer = true; } sender.SendAcceptCall(answer); }
void Terminal_TerminalEvent(ICommProvider sender, TerminalEventArgs e) { switch (e.EventType) { case EventTypeCodes.Connected: Buffer.PrintString("Connected"); Buffer.NewLine(); break; case EventTypeCodes.Disconnected: Buffer.PrintString("Disconnected: "); Buffer.PrintString(e.Message); Buffer.NewLine(); break; } }
private void RunCommand(TerminalEventArgs args) { label3.Text = args.Response.CentralCommand.ToString(); eCentralCommand ReceiveCommand = args.Response.CentralCommand; if (ReceiveCommand == eCentralCommand.Shutdown) { // MessageBox.Show("System Will shutdown..."); Process.Start("shutdown", "/s /t 0"); } else if (ReceiveCommand == eCentralCommand.Restart) { // MessageBox.Show("System Will restart..."); Process.Start("shutdown", "/r /t 0"); } }
// When a Change is happening in the terminal then run this. private void TerminalChanged(object sender, EventArgs e) { // A Temp Collection ObservableCollection <Terminal> temp = new ObservableCollection <Terminal>(Terminals); TerminalEventArgs tea = (TerminalEventArgs)e; if (tea != null) { // Set the temp terminal LuggageToBeBoarded to the senders LuggageToBeBoarded foreach (Terminal term in temp) { if (term.TerminalNumber.Equals(tea.Terminal.TerminalNumber)) { term.LuggageToBeBoarded = tea.Terminal.LuggageToBeBoarded; } } // The Bound Collection equals the temp collection Terminals = temp; } }
void _transport_TerminalEvent(ICommProvider sender, TerminalEventArgs e) { onTerminalEvent(e.EventType, e.Message); }
/// <summary> /// Have terminal output /// </summary> /// <param name="sender">The sending object</param> /// <param name="e">The terminal event arguments</param> private void OnTerminalPreResponse(object sender, TerminalEventArgs e) { }
/// <summary> /// Traps plugin specific cryptic entries and process them. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="e">Arguments from the terminal.</param> private void OnTerminalPreSend(object sender, TerminalEventArgs e) { }
void Modem_TerminalEvent(ICommProvider sender, TerminalEventArgs e) { onTerminalEvent(e); }