Example #1
0
        public TrustedAdvisorCategorySpecificSummary Unmarshall(JsonUnmarshallerContext context)
        {
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }

            TrustedAdvisorCategorySpecificSummary trustedAdvisorCategorySpecificSummary = new TrustedAdvisorCategorySpecificSummary();



            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if (context.TestExpression("costOptimizing", targetDepth))
                {
                    context.Read();
                    trustedAdvisorCategorySpecificSummary.CostOptimizing = TrustedAdvisorCostOptimizingSummaryUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.CurrentDepth <= originalDepth)
                {
                    return(trustedAdvisorCategorySpecificSummary);
                }
            }


            return(trustedAdvisorCategorySpecificSummary);
        }
        public TrustedAdvisorCategorySpecificSummary Unmarshall(JsonUnmarshallerContext context)
        {
            TrustedAdvisorCategorySpecificSummary trustedAdvisorCategorySpecificSummary = new TrustedAdvisorCategorySpecificSummary();

            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if ((context.IsKey) && (context.CurrentDepth == targetDepth))
                {
                    context.Read();
                    context.Read();

                    if (context.TestExpression("CostOptimizing", targetDepth))
                    {
                        trustedAdvisorCategorySpecificSummary.CostOptimizing = TrustedAdvisorCostOptimizingSummaryUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth <= originalDepth)
                {
                    return(trustedAdvisorCategorySpecificSummary);
                }
            }


            return(trustedAdvisorCategorySpecificSummary);
        }
 public static TrustedAdvisorCostOptimizingSummaryUnmarshaller GetInstance()
 {
     if (instance == null)
     {
         instance = new TrustedAdvisorCostOptimizingSummaryUnmarshaller();
     }
     return(instance);
 }