Exemplo n.º 1
0
        public StepStatus Unmarshall(JsonUnmarshallerContext context)
        {
            context.Read();
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }
            StepStatus stepStatus = new StepStatus();


            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("State", targetDepth))
                {
                    stepStatus.State = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("StateChangeReason", targetDepth))
                {
                    stepStatus.StateChangeReason = StepStateChangeReasonUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("Timeline", targetDepth))
                {
                    stepStatus.Timeline = StepTimelineUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }
            }

            return(stepStatus);
        }
Exemplo n.º 2
0
 public static StepTimelineUnmarshaller GetInstance()
 {
     if (instance == null)
     {
         instance = new StepTimelineUnmarshaller();
     }
     return(instance);
 }