示例#1
0
 private void btnRemoveUserName_Click(object sender, EventArgs e)
 {
     if (txtSearchUserName.Text == string.Empty)
     {
         return;
     }
     TCPServerDB.RemoveUserbyUserName(txtSearchUserName.Text);
 }
示例#2
0
 private void btnSearchUserName_Click(object sender, EventArgs e)
 {
     if (txtSearchUserName.Text == string.Empty)
     {
         return;
     }
     dgvUsers.DataSource = TCPServerDB.FindByUserNameList(txtSearchUserName.Text);
 }
示例#3
0
 private void btnSearchKeyword_Click(object sender, EventArgs e)
 {
     if (txtKeyword.Text == string.Empty)
     {
         return;
     }
     dgvMessages.DataSource = TCPServerDB.LookUpStoredMessages(txtKeyword.Text);
 }
示例#4
0
        public ServerControl(Connection c, Parcel firstMsg)
        {
            InitializeComponent();

            #region Adding ListView

            lstClients.Columns.Add("Name", -2, HorizontalAlignment.Left);
            lstClients.Columns.Add("Connection Status", -2, HorizontalAlignment.Center);
            lstClients.Columns.Add("Connection Start", -2, HorizontalAlignment.Right);
            tabMain.SelectedTab = tabChat;

            #endregion

            //event subscriptions
            TcpServerWrapper.ServerParcelReceived += TCPServer_ServerParcelReceived;
            TcpServerWrapper.ClientConnected      += TCPServer_ClientConnected;
            TcpServerWrapper.ClientDisconnected   += TCPServer_ClientDisconnected;

            // this variable holds the Current UI context for updating data in UI
            _ui = SynchronizationContext.Current;
            //Start of the whole programme
            TCPServerDB.Initialize();
            TcpServerWrapper.StartServer(c, firstMsg);
        }
示例#5
0
 private void btnSearchDate_Click(object sender, EventArgs e)
 {
     dateTimePicker1.Select();
     dgvMessages.DataSource = TCPServerDB.LookUpStoredMessages(dateTimePicker1.Value);
 }