コード例 #1
0
 private PromoItem GetItemFromJavaObject(AndroidJavaObject itemJavaObject)
 {
     return(new PromoItem
     {
         productId = itemJavaObject.SafeStringCall("getItemId"),
         itemType = itemJavaObject.SafeStringCall("getType"),
         quantity = itemJavaObject.Call <long>("getQuantity")
     });
 }
コード例 #2
0
        private Product GetPremiumProductFromJavaObject(AndroidJavaObject productJavaObject)
        {
            if (productJavaObject == null)
            {
                return(default(Product));
            }

            return(new Product
            {
                productId = productJavaObject.SafeStringCall("getProductId"),
                localizedPrice = (decimal)productJavaObject.Call <double>("getLocalizedPrice"),
                isoCurrencyCode = productJavaObject.SafeStringCall("getIsoCurrencyCode"),
                localizedPriceString = productJavaObject.SafeStringCall("getLocalizedPriceString"),
                localizedTitle = productJavaObject.SafeStringCall("getLocalizedTitle"),
                localizedDescription = productJavaObject.SafeStringCall("getLocalizedDescription"),
                productType = productJavaObject.SafeStringCall("getProductType")
            });
        }