public static void Main() { SAPPTcpClient app = new SAPPTcpClient(); app.InitializeComponent(); app.Run(); }
private void Window_client_ContentRendered(object sender, EventArgs e) { SAPPTcpClient.logger.Info("Finished rendering content for SAPPRemoteUI"); if (theme_p.SelectedItem is ColorDataList) { if (((ColorDataList)this.theme_p.SelectedItem).ColorMetadata == "REC") { SetTheme(((ColorDataList)this.theme_p.SelectedItem).ColorName); } else if (((ColorDataList)this.theme_p.SelectedItem).ColorMetadata != "SEP") { string cdata = ((ColorDataList)this.theme_p.SelectedItem).ColorMetadata; Color cx = (Color)System.Windows.Media.ColorConverter.ConvertFromString(cdata); SetTheme(cx); } } this.grid_loading.Visibility = Visibility.Hidden; if (SAPPTcpClient.ISettings.AutoConnect == true) { SAPPTcpClient.Connect(textBox_ip_port.Text); } textBox_password.Password = SAPPTcpClient.ISettings.Password; }
private void MenuItemClick(MenuItem mi) { try { string cmd = mi.Tag.ToString().Replace("%index", SelectedPD.Index.ToString()).Replace("%name", SelectedPD.Name); string outText = Json.GenerateString(new Command(cmd)); SAPPTcpClient.Send(SAPPTcpClient.clientSocket, outText); } catch (Exception ex) { SAPPTcpClient.logger.Error(ex, ex.Message); } }
private void Window_client_Closing(object sender, System.ComponentModel.CancelEventArgs e) { try { SAPPTcpClient.Disconnect(); } catch (Exception ex) { SAPPTcpClient.logger.Error(ex, ex.Message); } }
private void TextBox_command_KeyUp(object sender, KeyEventArgs e) { try { string outText = ""; if (e.Key == Key.Enter) { outText = Json.GenerateString(new Command(textBox_command.Text)); SAPPTcpClient.Send(SAPPTcpClient.clientSocket, outText); textBox_command.Text = ""; } } catch (Exception ex) { SAPPTcpClient.Disconnect(); if (e.Key == Key.Enter) { textBox_command.Text = ""; } SAPPTcpClient.logger.Error(ex, ex.Message); } }
private void Button_refresh_Click(object sender, RoutedEventArgs e) { SAPPTcpClient.SendQUERY(); }
private void Button_disconnect_Click(object sender, RoutedEventArgs e) { SAPPTcpClient.Disconnect(); }
private void Button_connect_Click(object sender, RoutedEventArgs e) { SAPPTcpClient.Connect(textBox_ip_port.Text); }
private void Updater_Tick(object sender, EventArgs e) { SAPPTcpClient.SendQUERY_STATS(); }