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


            int targetDepth = context.CurrentDepth;

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

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

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

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