예제 #1
0
        public static InvalidationBatchUnmarshaller GetInstance()
        {
            if (instance == null)
            {
                instance = new InvalidationBatchUnmarshaller();
            }

            return(instance);
        }
예제 #2
0
        public Invalidation Unmarshall(XmlUnmarshallerContext context)
        {
            Invalidation invalidation  = new Invalidation();
            int          originalDepth = context.CurrentDepth;
            int          targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Id", targetDepth))
                    {
                        invalidation.Id = StringUnmarshaller.GetInstance().Unmarshall(context);

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

                        continue;
                    }
                    if (context.TestExpression("CreateTime", targetDepth))
                    {
                        invalidation.CreateTime = DateTimeUnmarshaller.GetInstance().Unmarshall(context);

                        continue;
                    }
                    if (context.TestExpression("InvalidationBatch", targetDepth))
                    {
                        invalidation.InvalidationBatch = InvalidationBatchUnmarshaller.GetInstance().Unmarshall(context);

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



            return(invalidation);
        }