private static void UnmarshallResult(XmlUnmarshallerContext context, DeleteMessageBatchResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.ReadAtDepth(originalDepth))
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("BatchResultErrorEntry", targetDepth))
                    {
                        var unmarshaller = BatchResultErrorEntryUnmarshaller.GetInstance();
                        var item         = unmarshaller.Unmarshall(context);
                        response.Failed.Add(item);
                        continue;
                    }
                    if (context.TestExpression("DeleteMessageBatchResultEntry", targetDepth))
                    {
                        var unmarshaller = DeleteMessageBatchResultEntryUnmarshaller.GetInstance();
                        var item         = unmarshaller.Unmarshall(context);
                        response.Successful.Add(item);
                        continue;
                    }
                }
            }

            return;
        }
 public static BatchResultErrorEntryUnmarshaller GetInstance()
 {
     if (instance == null)
     {
         instance = new BatchResultErrorEntryUnmarshaller();
     }
     return(instance);
 }
Exemple #3
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, SendMessageBatchResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("SendMessageBatchResultEntry", targetDepth))
                    {
                        response.Successful.Add(SendMessageBatchResultEntryUnmarshaller.GetInstance().Unmarshall(context));

                        continue;
                    }
                    if (context.TestExpression("BatchResultErrorEntry", targetDepth))
                    {
                        response.Failed.Add(BatchResultErrorEntryUnmarshaller.GetInstance().Unmarshall(context));

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



            return;
        }