public StepDetail Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) { return(null); } StepDetail stepDetail = new StepDetail(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("StepConfig", targetDepth)) { stepDetail.StepConfig = StepConfigUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("ExecutionStatusDetail", targetDepth)) { stepDetail.ExecutionStatusDetail = StepExecutionStatusDetailUnmarshaller.GetInstance().Unmarshall(context); continue; } } return(stepDetail); }
public StepDetail Unmarshall(JsonUnmarshallerContext context) { StepDetail stepDetail = new StepDetail(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if ((context.IsKey) && (context.CurrentDepth == targetDepth)) { context.Read(); context.Read(); if (context.TestExpression("StepConfig", targetDepth)) { stepDetail.StepConfig = StepConfigUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("ExecutionStatusDetail", targetDepth)) { stepDetail.ExecutionStatusDetail = StepExecutionStatusDetailUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth <= originalDepth) { return(stepDetail); } } return(stepDetail); }
public static StepExecutionStatusDetailUnmarshaller GetInstance() { if (instance == null) { instance = new StepExecutionStatusDetailUnmarshaller(); } return(instance); }
public StepDetail Unmarshall(XmlUnmarshallerContext context) { StepDetail stepDetail = new StepDetail(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("StepConfig", targetDepth)) { stepDetail.StepConfig = StepConfigUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("ExecutionStatusDetail", targetDepth)) { stepDetail.ExecutionStatusDetail = StepExecutionStatusDetailUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(stepDetail); } } return(stepDetail); }