internal static MatchingTransactions getMatchingTransactions(HttpResponseMessage responce)
 {
     var matchingTransactions = new MatchingTransactions();
     var jsonObj = JsonConvert.DeserializeObject<Dictionary<string, object>>(responce.Content.ReadAsStringAsync().Result);
     if (jsonObj.ContainsKey("matching_transactions"))
     {
         var transArray = JsonConvert.DeserializeObject<List<object>>(jsonObj["matching_transactions"].ToString());
         foreach(var transactionObj in transArray)
         {
             var transaction = new Transaction();
             transaction = JsonConvert.DeserializeObject<Transaction>(transactionObj.ToString());
             matchingTransactions.Add(transaction);
         }
     }
     if (jsonObj.ContainsKey("page_context"))
     {
         var pageContext = new PageContext();
         pageContext = JsonConvert.DeserializeObject<PageContext>(jsonObj["page_context"].ToString());
         matchingTransactions.page_context = pageContext;
     }
     if (jsonObj.ContainsKey("instrumentation"))
     {
         var instrumentation = new Instrumentation();
         instrumentation = JsonConvert.DeserializeObject<Instrumentation>(jsonObj["instrumentation"].ToString());
         matchingTransactions.instrumentation = instrumentation;
     }
     return matchingTransactions;
 }
        internal static MatchingTransactions getMatchingTransactions(HttpResponseMessage responce)
        {
            var matchingTransactions = new MatchingTransactions();
            var jsonObj =
                JsonConvert.DeserializeObject <Dictionary <string, object> >(responce.Content.ReadAsStringAsync().Result);

            if (jsonObj.ContainsKey("matching_transactions"))
            {
                var transArray =
                    JsonConvert.DeserializeObject <List <object> >(jsonObj["matching_transactions"].ToString());
                foreach (var transactionObj in transArray)
                {
                    var transaction = new Transaction();
                    transaction = JsonConvert.DeserializeObject <Transaction>(transactionObj.ToString());
                    matchingTransactions.Add(transaction);
                }
            }
            if (jsonObj.ContainsKey("page_context"))
            {
                var pageContext = new PageContext();
                pageContext = JsonConvert.DeserializeObject <PageContext>(jsonObj["page_context"].ToString());
                matchingTransactions.page_context = pageContext;
            }
            if (jsonObj.ContainsKey("instrumentation"))
            {
                var instrumentation = new Instrumentation();
                instrumentation = JsonConvert.DeserializeObject <Instrumentation>(jsonObj["instrumentation"].ToString());
                matchingTransactions.instrumentation = instrumentation;
            }
            return(matchingTransactions);
        }
Пример #3
0
        /// <summary>
        /// </summary>
        private void ShowPreview()
        {
            MatchingTransactions.Clear();
            if (mSelectedRule == null)
            {
                return;
            }

            var previewedRule = Mapper.Map <ProcessingRule>(mSelectedRule);
            var transactions  = mTransactionDataService.GetAll();

            foreach (var transaction in transactions)
            {
                if (previewedRule.AppliesTo(transaction))
                {
                    MatchingTransactions.Add(transaction);
                }
            }
        }