Exemplo n.º 1
0
        private void Instance_OnInsertWaitingOrder(object sender, QHEvents.OrderArgs e)
        {
            if (RecordType != RecordListType.Waiting)
            {
                return;
            }

            if (this.InvokeRequired)
            {
                Invoke(new Action(() =>
                {
                    recordTransItemBindingSource.Add(e.order);
                }));
            }
            else
            {
                recordTransItemBindingSource.Add(e.order);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 用于平仓时,删除持仓信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Instance_OnRemovePosition(object sender, QHEvents.OrderArgs e)
        {
            if (RecordType != RecordListType.Position)
            {
                return;
            }

            if (this.InvokeRequired)
            {
                Invoke(new Action(() =>
                {
                    recordTransItemBindingSource.Remove(e.order);
                }));
            }
            else
            {
                recordTransItemBindingSource.Remove(e.order);
            }
        }