public WorkflowTypeInfos Unmarshall(JsonUnmarshallerContext context)
        {
            context.Read();
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }
            WorkflowTypeInfos workflowTypeInfos = new WorkflowTypeInfos();


            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("typeInfos", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <WorkflowTypeInfo, WorkflowTypeInfoUnmarshaller>(
                        WorkflowTypeInfoUnmarshaller.GetInstance());
                    workflowTypeInfos.TypeInfos = unmarshaller.Unmarshall(context);

                    continue;
                }

                if (context.TestExpression("nextPageToken", targetDepth))
                {
                    workflowTypeInfos.NextPageToken = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }
            }

            return(workflowTypeInfos);
        }
        public WorkflowTypeDetail Unmarshall(JsonUnmarshallerContext context)
        {
            WorkflowTypeDetail workflowTypeDetail = new WorkflowTypeDetail();

            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if ((context.IsKey) && (context.CurrentDepth == targetDepth))
                {
                    context.Read();
                    context.Read();

                    if (context.TestExpression("TypeInfo", targetDepth))
                    {
                        workflowTypeDetail.TypeInfo = WorkflowTypeInfoUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("Configuration", targetDepth))
                    {
                        workflowTypeDetail.Configuration = WorkflowTypeConfigurationUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth <= originalDepth)
                {
                    return(workflowTypeDetail);
                }
            }
            return(workflowTypeDetail);
        }
Exemplo n.º 3
0
        public WorkflowTypeDetail Unmarshall(JsonUnmarshallerContext context)
        {
            context.Read();
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }
            WorkflowTypeDetail workflowTypeDetail = new WorkflowTypeDetail();


            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("typeInfo", targetDepth))
                {
                    workflowTypeDetail.TypeInfo = WorkflowTypeInfoUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("configuration", targetDepth))
                {
                    workflowTypeDetail.Configuration = WorkflowTypeConfigurationUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }
            }

            return(workflowTypeDetail);
        }
Exemplo n.º 4
0
 public static WorkflowTypeInfoUnmarshaller GetInstance()
 {
     if (instance == null)
     {
         instance = new WorkflowTypeInfoUnmarshaller();
     }
     return(instance);
 }
Exemplo n.º 5
0
        public WorkflowTypeInfos Unmarshall(JsonUnmarshallerContext context)
        {
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }

            WorkflowTypeInfos workflowTypeInfos = new WorkflowTypeInfos();



            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if (context.TestExpression("typeInfos", targetDepth))
                {
                    context.Read();
                    workflowTypeInfos.TypeInfos = new List <WorkflowTypeInfo>();
                    WorkflowTypeInfoUnmarshaller unmarshaller = WorkflowTypeInfoUnmarshaller.GetInstance();
                    while (context.Read())
                    {
                        JsonToken token = context.CurrentTokenType;
                        if (token == JsonToken.ArrayStart)
                        {
                            continue;
                        }
                        if (token == JsonToken.ArrayEnd)
                        {
                            break;
                        }
                        workflowTypeInfos.TypeInfos.Add(unmarshaller.Unmarshall(context));
                    }
                    continue;
                }

                if (context.TestExpression("nextPageToken", targetDepth))
                {
                    context.Read();
                    workflowTypeInfos.NextPageToken = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.CurrentDepth <= originalDepth)
                {
                    return(workflowTypeInfos);
                }
            }


            return(workflowTypeInfos);
        }
        public WorkflowTypeInfos Unmarshall(JsonUnmarshallerContext context)
        {
            WorkflowTypeInfos workflowTypeInfos = new WorkflowTypeInfos();

            workflowTypeInfos.TypeInfos = null;

            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if ((context.IsKey) && (context.CurrentDepth == targetDepth))
                {
                    context.Read();
                    context.Read();

                    if (context.TestExpression("TypeInfos", targetDepth))
                    {
                        workflowTypeInfos.TypeInfos = new List <WorkflowTypeInfo>();
                        WorkflowTypeInfoUnmarshaller unmarshaller = WorkflowTypeInfoUnmarshaller.GetInstance();
                        while (context.Read())
                        {
                            if ((context.IsArrayElement) && (context.CurrentDepth == targetDepth))
                            {
                                workflowTypeInfos.TypeInfos.Add(unmarshaller.Unmarshall(context));
                            }
                            else if (context.IsEndArray)
                            {
                                break;
                            }
                        }
                        continue;
                    }

                    if (context.TestExpression("NextPageToken", targetDepth))
                    {
                        workflowTypeInfos.NextPageToken = StringUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth <= originalDepth)
                {
                    return(workflowTypeInfos);
                }
            }


            return(workflowTypeInfos);
        }