Esempio n. 1
0
        public static ExpirationUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new ExpirationUnmarshaller();
            }

            return(instance);
        }
Esempio n. 2
0
        public LifecycleRule Unmarshall(XmlUnmarshallerContext context)
        {
            LifecycleRule rulesItem     = new LifecycleRule();
            int           originalDepth = context.CurrentDepth;
            int           targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Expiration", targetDepth))
                    {
                        rulesItem.Expiration = ExpirationUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("ID", targetDepth))
                    {
                        rulesItem.Id = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Prefix", targetDepth))
                    {
                        rulesItem.Prefix = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Status", targetDepth))
                    {
                        rulesItem.Status = StringUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("Transition", targetDepth))
                    {
                        rulesItem.Transition = TransitionUnmarshaller.GetInstance().Unmarshall(context);

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



            return(rulesItem);
        }