Ejemplo 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);
        }
 public static StepStateChangeReasonUnmarshaller GetInstance()
 {
     if (instance == null)
     {
         instance = new StepStateChangeReasonUnmarshaller();
     }
     return(instance);
 }