Beispiel #1
0
        //private void dbView_CellFormatting(object sender, EventArgs e)
        //{
        //    if (e.ColumnIndex == 1)
        //    {
        //        if (e.Value != null)
        //        {
        //            string text = e.Value.ToString();
        //            if (text.Contains("Wait"))
        //            {
        //                e.CellStyle.ForeColor = Color.Yellow;
        //                e.CellStyle.SelectionForeColor = Color.Yellow;
        //            }
        //        }
        //    }
        //}
        #endregion

        private void OnRecevieViewList(object sender, SoketEventArgs e)
        {
            dataTable = Fomatter.xmlDataToDataTable(e.Message);

            if (InvokeRequired)
            {
                this.Invoke(new Action(
                                delegate()
                {
                    dgvMachineList.DataSource = dataTable;

                    foreach (DataGridViewRow row in dgvMachineList.Rows)
                    {
                        try
                        {
                            if (row.Cells[2].Value.Equals("WAIT"))
                            {
                                row.DefaultCellStyle.BackColor = Color.Red;
                            }
                        }
                        catch (Exception ex)
                        {
                            break;
                        }
                    }
                }
                                )
                            );
            }
            else
            {
                dgvMachineList.DataSource = dataTable;
            }
        }
Beispiel #2
0
        private void OnReceiveMeaasge(object sender, SoketEventArgs e)
        {
            logger.Info(string.Format("[{0}][{1}]{2}", e.ProtocolType, e.EndPoint, e.Message));
            //tbCommand.Text = string.Format("[{0}][{1}]{2}", e.ProtocolType, e.EndPoint, e.Message);

            //크로스 스레딩 (하나의 작업을 여러개의 스레드가 동시에 실행하려할때 발생) 해결하기위함
            if (this.InvokeRequired)
            {
                this.Invoke(new MethodInvoker(delegate()
                {
                    DataTable dataTable = Fomatter.xmlDataToDataTable(e.Message);
                    if (dataTable.Rows.Count > 0)
                    {
                        dgvMachinelist.DataSource = null;
                    }
                    dgvMachinelist.DataSource = dataTable;

                    foreach (DataGridViewRow row in dgvMachinelist.Rows)
                    {
                        try
                        {
                            if (row.Cells[2].Value.Equals("WAIT"))
                            {
                                row.DefaultCellStyle.BackColor = Color.Red;
                            }
                        }catch (Exception ex)
                        {
                            break;
                        }
                    }
                }));
            }
            else
            {
                DataTable dataTable = Fomatter.xmlDataToDataTable(e.Message);
                if (dataTable.Rows.Count > 0)
                {
                    dgvMachinelist.DataSource = null;
                }
                dgvMachinelist.DataSource = dataTable;
                tbCommand.Text            = "else";

                //foreach (DataGridViewRow row in dgvMachinelist.Rows)
                //{
                //    if (row.Cells[2].Value.Equals("WAIT"))
                //    {
                //        row.DefaultCellStyle.BackColor = Color.Red;
                //    }
                //}
            }
        }
Beispiel #3
0
        //private void dbView_CellFormatting(object sender, EventArgs e)
        //{
        //    if (e.ColumnIndex == 1)
        //    {
        //        if (e.Value != null)
        //        {
        //            string text = e.Value.ToString();
        //            if (text.Contains("Wait"))
        //            {
        //                e.CellStyle.ForeColor = Color.Yellow;
        //                e.CellStyle.SelectionForeColor = Color.Yellow;
        //            }
        //        }
        //    }
        //}
        #endregion

        private void OnRecevieViewList(object sender, SoketEventArgs e)
        {
            dataTable = Fomatter.xmlDataToDataTable(e.Message);

            if (InvokeRequired)
            {
                this.Invoke(new Action(
                                delegate()
                {
                    dgvMachineList.DataSource = dataTable;
                }
                                )
                            );
            }
            else
            {
                dgvMachineList.DataSource = dataTable;
            }
        }