//双击指标树节点添加指标信息到 指标信息列表中 private void treeView2_MouseDoubleClick(object sender, MouseEventArgs e) { TreeNode SelectedNode = this.treeView2.SelectedNode; ums_rptfunc data = (ums_rptfunc)SelectedNode.Tag; if (0 == data.ISGROUP) { ListViewItem ListItem = new ListViewItem(); ListItem.SubItems[0].Text = this.m_listViewQuota.Items.Count.ToString(); ListItem.SubItems[1].Text = data.FUNCNAME; ListItem.SubItems[2].Text = "=" + data.FUNCNAME; this.m_listViewQuota.Items.Add(ListItem); } }
public void OnLR() { NamedPipeClientStream ClientPipe = new NamedPipeClientStream(".", "__YiYi_Dance__", PipeDirection.InOut); ClientPipe.Connect(); my_header myheader = new my_header(); myheader._lCommandID = (UInt32)EXCEL_PROTOCOL_ID.ONLY_HEAD; myheader._lPackSize = 0; myheader._lExtendData = new UInt32[] { (UInt32)EXCEL_PROTOCOL_ID.REPORT_STOCK, 0, 0 }; byte[] buffer = StructToBytes(myheader); ClientPipe.Write(buffer, 0, buffer.Length); //ums_block_index byte[] headerbyte = new byte[20]; int readCount = 0; my_header myheaderrecv = new my_header(); if ((readCount = ClientPipe.Read(headerbyte, 0, 20)) > 0) { myheaderrecv = (my_header)BytesToStruct(headerbyte, myheaderrecv.GetType()); } byte[] datebyte = new byte[8613]; while (true) { readCount = ClientPipe.Read(datebyte, 0, 8613); if (readCount < 0) { break; } ums_rptfunc functemp = new ums_rptfunc(); functemp = (ums_rptfunc)BytesToStruct(datebyte, functemp.GetType()); rptfuncs.Add(functemp); if (rptfuncs.Count == myheaderrecv._lExtendData[0]) { break; } } rptfuncs.TrimToSize(); ClientPipe.Close(); }
public void ReadQuota() { NamedPipeClientStream ClientPipe = new NamedPipeClientStream(".", "__YiYi_Dance__", PipeDirection.InOut); ClientPipe.Connect(); my_header myheader = new my_header(); myheader._lCommandID = (UInt32)EXCEL_PROTOCOL_ID.ONLY_HEAD; myheader._lPackSize = 0; myheader._lExtendData = new UInt32[] { (UInt32)EXCEL_PROTOCOL_ID.REPORT_INDEX, 0, 0 }; byte[] buffer = StructToBytes(myheader); ClientPipe.Write(buffer, 0, buffer.Length); int bytesize = Marshal.SizeOf(typeof(my_header)); byte[] headerbyte = new byte[bytesize]; int readCount = 0; my_header myheaderrecv = new my_header(); if ((readCount = ClientPipe.Read(headerbyte, 0, bytesize)) > 0) { myheaderrecv = (my_header)BytesToStruct(headerbyte, myheaderrecv.GetType()); } bytesize = Marshal.SizeOf(typeof(ums_rptfunc)); byte[] datebyte = new byte[bytesize]; while (true) { if (rptfuncs.Count == myheaderrecv._lExtendData[0]) { break; } readCount = ClientPipe.Read(datebyte, 0, bytesize); if (readCount < 0) { break; } ums_rptfunc functemp = new ums_rptfunc(); functemp = (ums_rptfunc)BytesToStruct(datebyte, functemp.GetType()); rptfuncs.Add(functemp); } rptfuncs.TrimToSize(); ClientPipe.Close(); }