コード例 #1
0
        public void UpdateMyOpenOrders_UIResultHandler(RequestItemGroup resultResponse)
        {
            if (RequestManager.IsResultHasErrors(resultResponse))
            {
                return;
            }
            List <OpenOrder> myOpenOrders = (List <OpenOrder>)resultResponse.items[0].result.resultData;

            var dataView = myOpenOrders.Select(item => new
            {
                openUuid  = item.openUuid,
                date      = item.openedDate,
                orderType = item.orderType,
                price     = Helper.PriceToStringBtc(item.price),
                amount    = Helper.PriceToStringBtc(item.quantity),
                remain    = Helper.PriceToStringBtc(item.quantityRemaining)
            }).ToList();

            GVButtonColumn  buttDeleteRow = new GVButtonColumn("delete", "", "c_button", "Cancel");
            List <GVColumn> columns       = new List <GVColumn>()
            {
                new GVColumn("openUuid", "Order Id", "string"),
                new GVColumn("date", "Date", "string"),
                new GVColumn("orderType", "Type", "string"),
                new GVColumn("price", "Price", "string"),
                new GVColumn("amount", "Amount", "string"),
                new GVColumn("remain", "Remain", "string"),
                buttDeleteRow
            };

            //            GVState gvstate = new GVState();
            if (gvMyOpenOrders == null)
            {
                gvMyOpenOrders = new DataGridViewExWrapper();
            }
            gvMyOpenOrders.Create(dgridOpenOrders, dataView, columns, true);
            gvMyOpenOrders.AutoSizeFillExcept("date");
            gvMyOpenOrders.RowColorByCondition("orderType", "SELL LIMIT", Color.LightPink);

            /*
             * List<DGVColumn> columns = new List<DGVColumn>()
             * {
             *  new DGVColumn( "date", "Date","string") ,
             *  new DGVColumn( "orderType", "Type","string") ,
             *  new DGVColumn( "price", "Price","string") ,
             *  new DGVColumn( "amount", "Amount","string") ,
             *  new DGVColumn( "remain", "Remain","string")
             * };
             * DataGridViewWrapper gv = new DataGridViewWrapper(dgridOpenOrders, true);
             * gv.Create(dataView, columns);
             * gv.AutoSizeDisplayedExcept("price");
             * gv.RowColorByCondition("orderType", "SELL LIMIT", Color.LightPink);
             */
        }
コード例 #2
0
        public void ShowAlertList()
        {
            var dataView = AlertManager.alerts.Select(item => new
            {
                id           = item.Value.id.ToString(),
                caption      = item.Value.caption,
                tickerPair   = item.Value.tickerPair,
                priceAlert   = item.Value.priceAlert.ToString(),
                playSound    = item.Value.playSound.ToString(),
                showInChart  = item.Value.showInChart.ToString(),
                enabled      = item.Value.enabled.ToString(),
                alertExecute = item.Value.alertExecute.ToString()
            }).ToList();

            GVButtonColumn  buttEnableAlert = new GVButtonColumn("enable", "", "c_button", "On\\Off");
            GVButtonColumn  buttEditAlert   = new GVButtonColumn("edit", "", "c_button", "Edit");
            GVButtonColumn  buttDeleteAlert = new GVButtonColumn("delete", "", "c_button", "Delete");
            List <GVColumn> columns         = new List <GVColumn>()
            {
                new GVColumn("id", "Id", "string"),
                new GVColumn("caption", "Name", "string"),
                new GVColumn("tickerPair", "Currency", "string"),
                new GVColumn("priceAlert", "Alert Price", "string"),
                new GVColumn("playSound", "PlaySound", "string"),
                new GVColumn("showInChart", "ShowInChart", "string"),
                new GVColumn("enabled", "Enabled", "string"),
                new GVColumn("alertExecute", "Executing", "string"),
                buttEnableAlert,
                buttEditAlert,
                buttDeleteAlert
            };

            if (gvAlerts == null)
            {
                gvAlerts = new DataGridViewExWrapper();
            }
            gvAlerts.Create(dGridAlerts, dataView, columns, true);
            gvAlerts.AutoSizeFillExcept("caption");
            gvAlerts.RowColorByCondition("alertExecute", "True", Color.LightPink);
        }