public Chat(string user, Socket client, SynChat Formular, int i, ImageList status_images) { chatid = i; Buddy = user; MainForm = Formular; Client = client; StatusImages = status_images; InitializeComponent(); // Try to request the current status of a user try { Client.Send(cmd.buddy_status_request(user)); } catch (SocketException) { MainForm.debugFile.Write(@"Error at requesting new status"); } // Open connection to sqlite database and make sure that all tables exist connection.ConnectionString = "Data Source=" + dataSource; connection.Open(); SQLiteCommand create_conversations_table = new SQLiteCommand(connection); create_conversations_table.CommandText = "CREATE TABLE IF NOT EXISTS \"main\".\"conversations\" (\"conv_id\" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , \"conv_date\" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, \"conv_buddyname\" VARCHAR, \"conv_username\" VARCHAR)"; create_conversations_table.ExecuteNonQuery(); SQLiteCommand create_messages_table = new SQLiteCommand(connection); create_messages_table.CommandText = "CREATE TABLE IF NOT EXISTS \"messages\" (\"msg_id\" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , \"msg_text\" VARCHAR, \"msg_buddyname\" VARCHAR, \"msg_conv_date\" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, \"msg_username\" VARCHAR, \"msg_sender\" VARCHAR);"; create_messages_table.ExecuteNonQuery(); }
public Login_Popup(Socket client, SynChat Formular) { InitializeComponent(); Client = client; MainForm = Formular; tb_login_user.Text = Properties.Settings.Default.client_username; tb_masked_login_password.Text = Properties.Settings.Default.client_password; }
public settings(SynChat mainform) { InitializeComponent(); // Set all Checkboxes to current values if (Properties.Settings.Default.client_sounds_enabled) { cb_sounds.Checked = true; } if (Properties.Settings.Default.client_save_account_data) { cb_save_account_data.Checked = true; } if (Properties.Settings.Default.client_log_conversations) { cb_log_conversations.Checked = true; } MainForm = mainform; }
public Register_Popup(Socket client, SynChat mainform) { InitializeComponent(); MainForm = mainform; Client = client; }