protected void eHandler(DK1EventArgs e) { EventHandler<DK1EventArgs> handler = eDataReceive; if (handler != null) { handler(this, e); } }
/// <summary> /// 통신 이벤트 수신 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void comm_eDataReceive(object sender, DK1EventArgs e) { if (e.GetType().Equals(typeof(DK1DataArgs))) { // add log DK1DataArgs test = (DK1DataArgs)e; //CurrentForm. } }
/// <summary> /// 통신 이벤트 수신 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void comm_eDataReceive(object sender, DK1EventArgs e) { if (e.GetType().Equals(typeof(DK1DataArgs))) { // add log DK1DataArgs test = (DK1DataArgs)e; if (memoEdit1.Text.Length == 1024) memoEdit1.SafeInvoke(d => d.Text = (DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss [RECV] ") + test.Data + "\r\n")); else memoEdit1.SafeInvoke(d => d.Text += (DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss [RECV] ") + test.Data + "\r\n")); memoEdit1.SafeInvoke(d => d.SelectionStart = memoEdit1.Text.Length); memoEdit1.SafeInvoke(d => d.ScrollToCaret()); //byte[] data = DK1Util.HexStringToByteArray(test.Data); //SetValue(gridControl1.DataSource, 3, 5, Convert.ToInt64(data[15])); } }