Exemple #1
0
        public void SetCoinTradeHistory(string sPriceTpye, EnumLib.ExchangeCurrencyCode val)
        {
            try
            {
                PriceType = sPriceTpye;
                Excucode  = val;

                buyTitle  = Excucode.ToString() + "/" + PriceType;
                sellTitle = Excucode.ToString() + "/" + PriceType;
                compTitle = Excucode.ToString() + "/" + PriceType;

                if (PriceType.Equals(CommonLib.StandardCurcyNm))
                {
                    ResponseCoinListModel cl = MainViewModel.CoinData.list.Where(w => w.CoinCode == StringEnum.GetStringValue(val)).FirstOrDefault();
                    CommonFloat = "n" + (cl == null ? "0" : cl.CashDecimal.ToString());
                }
                else
                {
                    CommonFloat = "n8";
                }
                SearchBuyWait(10);
                SearchSellWait(10);
                SearchTradeComplete(10);
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }
        public void ChangeCoin(string sPriceType, string sPriceCode, EnumLib.ExchangeCurrencyCode val)
        {
            try
            {
                EnumLib.ExchangeCurrencyCode BeforeKindOfCoin = SelectCoinCode;

                PriceType = sPriceType;
                PriceCode = sPriceCode;

                if (PriceType.Equals(CommonLib.StandardCurcyNm))
                {
                    CommonFloat = "###,###,###,###,##0";
                    CommonNum   = "n0";
                }
                else
                {
                    CommonFloat = "###,###,###,###,##0.########";
                    CommonNum   = "n8";
                }

                SelectCoinCode = val;

                //if (DispatcherService != null)
                //{
                //    DispatcherService.BeginInvoke(() =>
                //    {
                //        BuyOrdelData.Clear();
                //        SellOrdelData.Clear();
                //    });
                //}

                if (MainViewModel.mQClient.CoinInfoData2.ToList().Where(w => w.Key.Key == sPriceCode && w.Key.Value == StringEnum.GetStringValue(SelectCoinCode)).Count() > 0)
                {
                    CoinInfoSocketData(MainViewModel.mQClient.CoinInfoData2[new KeyValuePair <string, string>(sPriceCode, StringEnum.GetStringValue(SelectCoinCode))]);
                }
                if (MainViewModel.mQClient.OrderData2.ToList().Where(w => w.Key.Key == sPriceCode && w.Key.Value == StringEnum.GetStringValue(SelectCoinCode)).Count() > 0)
                {
                    OrderSocketData(MainViewModel.mQClient.OrderData2[new KeyValuePair <string, string>(sPriceCode, StringEnum.GetStringValue(SelectCoinCode))]);
                }
                if (MainViewModel.mQClient.FillData2.ToList().Where(w => w.Key.Key == sPriceCode && w.Key.Value == StringEnum.GetStringValue(SelectCoinCode)).Count() > 0)
                {
                    FillSocketData(MainViewModel.mQClient.FillData2[new KeyValuePair <string, string>(sPriceCode, StringEnum.GetStringValue(SelectCoinCode))]);
                }

                //Dictionary<string, EnumLib.ExchangeCurrencyCode> dict = new Dictionary<string, EnumLib.ExchangeCurrencyCode>();
                //dict.Add(this.GetType().BaseType.Name, SelectCoinCode);
                //Messenger.Default.Send(dict);

                Dictionary <string, Dictionary <string, EnumLib.ExchangeCurrencyCode> > dict = new Dictionary <string, Dictionary <string, EnumLib.ExchangeCurrencyCode> >();
                Dictionary <string, EnumLib.ExchangeCurrencyCode> dictTemp = new Dictionary <string, EnumLib.ExchangeCurrencyCode>();

                dictTemp.Add(PriceCode, SelectCoinCode);
                dict.Add(this.GetType().BaseType.Name, dictTemp);
                Messenger.Default.Send(dict);
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
        }