Exemplo n.º 1
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, SendMessageBatchResponse 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("SendMessageBatchResultEntry", targetDepth))
                    {
                        var unmarshaller = SendMessageBatchResultEntryUnmarshaller.GetInstance();
                        var item         = unmarshaller.Unmarshall(context);
                        response.Successful.Add(item);
                        continue;
                    }
                }
            }

            return;
        }
Exemplo n.º 2
0
 public static SendMessageBatchResultEntryUnmarshaller GetInstance()
 {
     if (instance == null)
     {
         instance = new SendMessageBatchResultEntryUnmarshaller();
     }
     return(instance);
 }