public ActivityTypeDetail Unmarshall(JsonUnmarshallerContext context)
        {
            ActivityTypeDetail activityTypeDetail = new ActivityTypeDetail();

            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))
                    {
                        activityTypeDetail.TypeInfo = ActivityTypeInfoUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("Configuration", targetDepth))
                    {
                        activityTypeDetail.Configuration = ActivityTypeConfigurationUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth <= originalDepth)
                {
                    return(activityTypeDetail);
                }
            }


            return(activityTypeDetail);
        }
예제 #2
0
        public ActivityTypeDetail Unmarshall(JsonUnmarshallerContext context)
        {
            context.Read();
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }
            ActivityTypeDetail activityTypeDetail = new ActivityTypeDetail();


            int targetDepth = context.CurrentDepth;

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

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

            return(activityTypeDetail);
        }
예제 #3
0
 public static ActivityTypeConfigurationUnmarshaller GetInstance()
 {
     if (instance == null)
     {
         instance = new ActivityTypeConfigurationUnmarshaller();
     }
     return(instance);
 }