Пример #1
0
        public static void AssignValue(DataListCallback callback, string fieldName)
        {
            DataFieldAssignWindow assignWindow = GetWindow <DataFieldAssignWindow>();

            assignWindow.Callback = (data, path) =>
            {
                callback(data, path);
                assignWindow.Close();
            };
            assignWindow.Show();
            assignWindow._fieldName = fieldName;
            assignWindow.Expanded   = new bool[DataUtils.GetDataTypes().Length];
        }
Пример #2
0
        public void TestQueryNotice()
        {
            var queryNoticeCallback = new DataListCallback <NoticeInfo>((DataListResult <NoticeInfo> result) =>
            {
                if (result.IsSuccess)
                {
                    Console.WriteLine("客户通知条数:" + result.Result.Count);
                }
                Assert.IsTrue(result.IsSuccess);
            });

            _adapter.QueryNotice(queryNoticeCallback);
            Thread.Sleep(200);
        }
Пример #3
0
        public void TestQueryInstrument()
        {
            var callback = new DataListCallback <InstrumentInfo>((DataListResult <InstrumentInfo> result) =>
            {
                if (result.IsSuccess)
                {
                    Console.WriteLine("合约条数:" + result.Result.Count);
                }
                Assert.IsTrue(result.IsSuccess);
            });

            _adapter.QueryInstrument(callback, null);
            Thread.Sleep(500);
        }
Пример #4
0
        public void TestQueryParkedOrderAction()
        {
            var callback = new DataListCallback <ParkedCanelOrderInfo>((DataListResult <ParkedCanelOrderInfo> result) =>
            {
                if (result.IsSuccess)
                {
                    Console.WriteLine("预埋撤单条数:" + result.Result.Count);
                }
                Assert.IsTrue(result.IsSuccess);
            });

            _adapter.QueryParkedOrderAction(callback);
            Thread.Sleep(100);
        }
Пример #5
0
        public void TestQueryInvestorPositionDetail()
        {
            var queryInvestorPositionDetailCallback = new DataListCallback <PositionDetailInfo>((DataListResult <PositionDetailInfo> result) =>
            {
                if (result.IsSuccess)
                {
                    Console.WriteLine("投资者持仓明细条数:" + result.Result.Count);
                }
                Assert.IsTrue(result.IsSuccess);
            });
            string InstrumentID = "TF1809";

            _adapter.QueryInvestorPositionDetail(queryInvestorPositionDetailCallback, InstrumentID);
            Thread.Sleep(200);
        }
Пример #6
0
        public void TestQueryTrade()
        {
            var queryPositionCallback = new DataListCallback <TradeInfo>((DataListResult <TradeInfo> result) =>
            {
                if (result.IsSuccess)
                {
                    foreach (TradeInfo tradeInfo in result.Result)
                    {
                        Console.WriteLine("成交查询成功, TradeID: {0}", tradeInfo.TradeID);
                    }
                }
                Assert.IsTrue(result.IsSuccess);
            });

            _adapter.QueryTrade(queryPositionCallback);
            Thread.Sleep(100);
        }
Пример #7
0
        public void TestQueryOrder()
        {
            var queryOrderCallback = new DataListCallback <OrderInfo>((DataListResult <OrderInfo> result) =>
            {
                if (result.IsSuccess)
                {
                    foreach (OrderInfo orderInfo in result.Result)
                    {
                        Console.WriteLine("报单查询成功, OrderSysID: {0},OrderRef: {1},ExchangeID: {2}", orderInfo.OrderSysID, orderInfo.OrderRef, orderInfo.ExchangeID);
                    }
                }
                Assert.IsTrue(result.IsSuccess);
            });

            _adapter.QueryOrder(queryOrderCallback);
            Thread.Sleep(100);
        }
Пример #8
0
        public void TestQueryPosition()
        {
            var queryPositionCallback = new DataListCallback <PositionInfo>((DataListResult <PositionInfo> result) =>
            {
                if (result.IsSuccess)
                {
                    foreach (PositionInfo positionInfo in result.Result)
                    {
                        Console.WriteLine("投资者持仓查询成功, InstrumentID: {0}", positionInfo.InstrumentID);
                    }
                }
                Assert.IsTrue(result.IsSuccess);
            });

            _adapter.QueryPosition(queryPositionCallback);
            Thread.Sleep(100);
        }
Пример #9
0
        public void TestQueryTrade()
        {
            var queryPositionCallback = new DataListCallback <TradeInfo>((DataListResult <TradeInfo> result) =>
            {
                if (result.IsSuccess)
                {
                    Console.WriteLine("成交查询成功,记录条数:{0}", result.Result.Count);
                }
                else
                {
                    Console.WriteLine("成交查询失败:{0}", result.Error);
                }
                Assert.IsTrue(result.IsSuccess);
            });

            _adapter.QueryTrade(queryPositionCallback);
            Thread.Sleep(100);
        }
Пример #10
0
        public void TestQueryOrder()
        {
            var queryOrderCallback = new DataListCallback <OrderInfo>((DataListResult <OrderInfo> result) =>
            {
                if (result.IsSuccess)
                {
                    Console.WriteLine("报单查询成功, 记录条数:{0}", result.Result.Count);
                }
                else
                {
                    Console.WriteLine("报单查询失败:{0}", result.Error);
                }
                Assert.IsTrue(result.IsSuccess);
            });

            _adapter.QueryOrder(queryOrderCallback);
            Thread.Sleep(100);
        }