示例#1
0
        public TransaqStopOrder(string data)
        {
            this.TransactionId = this.ActiveOrderNo = -1L;
            this.Status        = this.WithdrawTime = this.Result = string.Empty;
            this.StopLoss      = new TransaqStoploss(string.Empty);
            this.TakeProfit    = new TransaqTakeprofit(string.Empty);
            string[] strArray1 = data.Split(new char[1]
            {
                '|'
            });
            for (int index1 = 0; index1 < strArray1.Length; ++index1)
            {
                string[] strArray2 = strArray1[index1].Split(new char[1]
                {
                    ';'
                });
                if (strArray2[0] == "stoporder")
                {
                    int index2 = 1;
                    while (index2 < strArray2.Length)
                    {
                        switch (strArray2[index2])
                        {
                        case "transactionid":
                            this.TransactionId = long.Parse(strArray2[index2 + 1]);
                            break;

                        case "activeorderno":
                            this.ActiveOrderNo = long.Parse(strArray2[index2 + 1]);
                            break;

                        case "status":
                            this.Status = strArray2[index2 + 1];
                            break;

                        case "withdrawtime":
                            this.WithdrawTime = strArray2[index2 + 1];
                            break;

                        case "result":
                            this.Result = strArray2[index2 + 1];
                            break;
                        }
                        index2 += 2;
                    }
                }
                if (strArray2[0] == "stoploss")
                {
                    this.StopLoss = new TransaqStoploss(strArray1[index1]);
                }
                if (strArray2[0] == "takeprofit")
                {
                    this.TakeProfit = new TransaqTakeprofit(strArray1[index1]);
                }
            }
        }
示例#2
0
 public TransaqStopOrder(string data)
 {
   this.TransactionId = this.ActiveOrderNo = -1L;
   this.Status = this.WithdrawTime = this.Result = string.Empty;
   this.StopLoss = new TransaqStoploss(string.Empty);
   this.TakeProfit = new TransaqTakeprofit(string.Empty);
   string[] strArray1 = data.Split(new char[1]
   {
     '|'
   });
   for (int index1 = 0; index1 < strArray1.Length; ++index1)
   {
     string[] strArray2 = strArray1[index1].Split(new char[1]
     {
       ';'
     });
     if (strArray2[0] == "stoporder")
     {
       int index2 = 1;
       while (index2 < strArray2.Length)
       {
         switch (strArray2[index2])
         {
           case "transactionid":
             this.TransactionId = long.Parse(strArray2[index2 + 1]);
             break;
           case "activeorderno":
             this.ActiveOrderNo = long.Parse(strArray2[index2 + 1]);
             break;
           case "status":
             this.Status = strArray2[index2 + 1];
             break;
           case "withdrawtime":
             this.WithdrawTime = strArray2[index2 + 1];
             break;
           case "result":
             this.Result = strArray2[index2 + 1];
             break;
         }
         index2 += 2;
       }
     }
     if (strArray2[0] == "stoploss")
       this.StopLoss = new TransaqStoploss(strArray1[index1]);
     if (strArray2[0] == "takeprofit")
       this.TakeProfit = new TransaqTakeprofit(strArray1[index1]);
   }
 }