Exemplo n.º 1
0
        public static LBCookieStickinessPolicyUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new LBCookieStickinessPolicyUnmarshaller();
            }

            return(instance);
        }
        public Policies Unmarshall(UnmarshallerContext context)
        {
            Policies policies      = new Policies();
            int      originalDepth = context.CurrentDepth;
            int      targetDepth   = originalDepth + 1;

            if (context.IsStartOfDocument)
            {
                targetDepth += 2;
            }

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("AppCookieStickinessPolicies/member", targetDepth))
                    {
                        policies.AppCookieStickinessPolicies.Add(AppCookieStickinessPolicyUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("LBCookieStickinessPolicies/member", targetDepth))
                    {
                        policies.LBCookieStickinessPolicies.Add(LBCookieStickinessPolicyUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return(policies);
                }
            }

            return(policies);
        }