public BootstrapActionConfig Unmarshall(JsonUnmarshallerContext context) { BootstrapActionConfig bootstrapActionConfig = new BootstrapActionConfig(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; while (context.Read()) { if ((context.IsKey) && (context.CurrentDepth == targetDepth)) { context.Read(); context.Read(); if (context.TestExpression("Name", targetDepth)) { bootstrapActionConfig.Name = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("ScriptBootstrapAction", targetDepth)) { bootstrapActionConfig.ScriptBootstrapAction = ScriptBootstrapActionConfigUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth <= originalDepth) { return(bootstrapActionConfig); } } return(bootstrapActionConfig); }
public BootstrapActionConfig Unmarshall(JsonUnmarshallerContext context) { context.Read(); if (context.CurrentTokenType == JsonToken.Null) { return(null); } BootstrapActionConfig bootstrapActionConfig = new BootstrapActionConfig(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("Name", targetDepth)) { bootstrapActionConfig.Name = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("ScriptBootstrapAction", targetDepth)) { bootstrapActionConfig.ScriptBootstrapAction = ScriptBootstrapActionConfigUnmarshaller.GetInstance().Unmarshall(context); continue; } } return(bootstrapActionConfig); }
public static ScriptBootstrapActionConfigUnmarshaller GetInstance() { if (instance == null) { instance = new ScriptBootstrapActionConfigUnmarshaller(); } return(instance); }
public BootstrapActionConfig Unmarshall(XmlUnmarshallerContext context) { BootstrapActionConfig bootstrapActionConfig = new BootstrapActionConfig(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("Name", targetDepth)) { bootstrapActionConfig.Name = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("ScriptBootstrapAction", targetDepth)) { bootstrapActionConfig.ScriptBootstrapAction = ScriptBootstrapActionConfigUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(bootstrapActionConfig); } } return(bootstrapActionConfig); }