Returns information about the DescribeAddresses response and response metadata.
Inheritance: DescribeAddressesResult
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            DescribeAddressesResponse response = new DescribeAddressesResponse();

            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("addressesSet/item", targetDepth))
                    {
                        var unmarshaller = AddressUnmarshaller.Instance;
                        var item = unmarshaller.Unmarshall(context);
                        response.Addresses.Add(item);
                        continue;
                    }
                } 
            }

            return response;
        }
Beispiel #2
0
 public List <Address> DescribeAddresses()
 {
     try
     {
         AWSModel.DescribeAddressesRequest  request  = new AWSModel.DescribeAddressesRequest();
         AWSModel.DescribeAddressesResponse response = ec2.DescribeAddresses(request);
         List <Address> addresses = new List <Address>();
         if (response != null)
         {
             foreach (AWSModel.Address address in response.DescribeAddressesResult.Address)
             {
                 Address address_ = ModelUtil.CreateInstance(address);
                 addresses.Add(address_);
             }
         }
         return(addresses);
     }
     catch (WebException e)
     {
         throw new MonoscapeEC2Exception(e.Message, e);
     }
     catch (AmazonEC2Exception e)
     {
         throw new MonoscapeEC2Exception(e.Message, e);
     }
 }
 public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) 
 {   
     DescribeAddressesResponse response = new DescribeAddressesResponse();
     
     int targetDepth = 2;
     while (context.Read())
     {
         if (context.IsStartElement || context.IsAttribute)
         {
             
             if (context.TestExpression("addressesSet/item", targetDepth))
             {
                 response.Addresses.Add(AddressUnmarshaller.GetInstance().Unmarshall(context));
                     
                 continue;
             }
         }
     }
          
                 
     return response;
 }