Beispiel #1
0
 public MATItemIos(MATItem matItem)
 {
     this.name       = matItem.name;
     this.unitPrice  = matItem.unitPrice ?? 0;
     this.quantity   = matItem.quantity ?? 0;
     this.revenue    = matItem.revenue ?? 0;
     this.attribute1 = matItem.attribute1;
     this.attribute2 = matItem.attribute2;
     this.attribute3 = matItem.attribute3;
     this.attribute4 = matItem.attribute4;
     this.attribute5 = matItem.attribute5;
 }
Beispiel #2
0
        public MATItemIos(MATItem matItem)
        {
            this.name = matItem.name;
            double?unitPrice = matItem.unitPrice;

            this.unitPrice = !unitPrice.HasValue ? 0.0 : unitPrice.Value;
            int?quantity = matItem.quantity;

            this.quantity = !quantity.HasValue ? 0 : quantity.Value;
            double?revenue = matItem.revenue;

            this.revenue    = !revenue.HasValue ? 0.0 : revenue.Value;
            this.attribute1 = matItem.attribute1;
            this.attribute2 = matItem.attribute2;
            this.attribute3 = matItem.attribute3;
            this.attribute4 = matItem.attribute4;
            this.attribute5 = matItem.attribute5;
        }
Beispiel #3
0
        public MATItemIos(MATItem matItem)
        {
            this.name = matItem.name;
            double?num = matItem.unitPrice;

            this.unitPrice = ((!num.HasValue) ? 0.0 : num.Value);
            int?num2 = matItem.quantity;

            this.quantity = ((!num2.HasValue) ? 0 : num2.Value);
            double?num3 = matItem.revenue;

            this.revenue    = ((!num3.HasValue) ? 0.0 : num3.Value);
            this.attribute1 = matItem.attribute1;
            this.attribute2 = matItem.attribute2;
            this.attribute3 = matItem.attribute3;
            this.attribute4 = matItem.attribute4;
            this.attribute5 = matItem.attribute5;
        }
Beispiel #4
0
        private AndroidJavaObject GetMATEventJavaObject(MATEvent matEvent)
        {
            AndroidJavaObject androidJavaObject;

            if (matEvent.name == null)
            {
                androidJavaObject = new AndroidJavaObject("com.mobileapptracker.MATEvent", new object[]
                {
                    matEvent.id
                });
            }
            else
            {
                androidJavaObject = new AndroidJavaObject("com.mobileapptracker.MATEvent", new object[]
                {
                    matEvent.name
                });
            }
            double?revenue = matEvent.revenue;

            if (revenue.HasValue)
            {
                androidJavaObject = androidJavaObject.Call <AndroidJavaObject>("withRevenue", new object[]
                {
                    matEvent.revenue
                });
            }
            if (matEvent.currencyCode != null)
            {
                androidJavaObject = androidJavaObject.Call <AndroidJavaObject>("withCurrencyCode", new object[]
                {
                    matEvent.currencyCode
                });
            }
            if (matEvent.advertiserRefId != null)
            {
                androidJavaObject = androidJavaObject.Call <AndroidJavaObject>("withAdvertiserRefId", new object[]
                {
                    matEvent.advertiserRefId
                });
            }
            if (matEvent.eventItems != null)
            {
                AndroidJavaObject androidJavaObject2 = new AndroidJavaObject("java.util.ArrayList", new object[0]);
                MATItem[]         eventItems         = matEvent.eventItems;
                for (int i = 0; i < eventItems.Length; i++)
                {
                    MATItem           mATItem            = eventItems[i];
                    AndroidJavaObject androidJavaObject3 = new AndroidJavaObject("com.mobileapptracker.MATEventItem", new object[]
                    {
                        mATItem.name
                    });
                    int?quantity = mATItem.quantity;
                    if (quantity.HasValue)
                    {
                        androidJavaObject3 = androidJavaObject3.Call <AndroidJavaObject>("withQuantity", new object[]
                        {
                            mATItem.quantity
                        });
                    }
                    double?unitPrice = mATItem.unitPrice;
                    if (unitPrice.HasValue)
                    {
                        androidJavaObject3 = androidJavaObject3.Call <AndroidJavaObject>("withUnitPrice", new object[]
                        {
                            mATItem.unitPrice
                        });
                    }
                    double?revenue2 = mATItem.revenue;
                    if (revenue2.HasValue)
                    {
                        androidJavaObject3 = androidJavaObject3.Call <AndroidJavaObject>("withRevenue", new object[]
                        {
                            mATItem.revenue
                        });
                    }
                    if (mATItem.attribute1 != null)
                    {
                        androidJavaObject3 = androidJavaObject3.Call <AndroidJavaObject>("withAttribute1", new object[]
                        {
                            mATItem.attribute1
                        });
                    }
                    if (mATItem.attribute2 != null)
                    {
                        androidJavaObject3 = androidJavaObject3.Call <AndroidJavaObject>("withAttribute2", new object[]
                        {
                            mATItem.attribute2
                        });
                    }
                    if (mATItem.attribute3 != null)
                    {
                        androidJavaObject3 = androidJavaObject3.Call <AndroidJavaObject>("withAttribute3", new object[]
                        {
                            mATItem.attribute3
                        });
                    }
                    if (mATItem.attribute4 != null)
                    {
                        androidJavaObject3 = androidJavaObject3.Call <AndroidJavaObject>("withAttribute4", new object[]
                        {
                            mATItem.attribute4
                        });
                    }
                    if (mATItem.attribute5 != null)
                    {
                        androidJavaObject3 = androidJavaObject3.Call <AndroidJavaObject>("withAttribute5", new object[]
                        {
                            mATItem.attribute5
                        });
                    }
                    androidJavaObject2.Call <bool>("add", new object[]
                    {
                        androidJavaObject3
                    });
                }
                androidJavaObject = androidJavaObject.Call <AndroidJavaObject>("withEventItems", new object[]
                {
                    androidJavaObject2
                });
            }
            if (matEvent.receipt != null && matEvent.receiptSignature != null)
            {
                androidJavaObject = androidJavaObject.Call <AndroidJavaObject>("withReceipt", new object[]
                {
                    matEvent.receipt,
                    matEvent.receiptSignature
                });
            }
            if (matEvent.contentType != null)
            {
                androidJavaObject = androidJavaObject.Call <AndroidJavaObject>("withContentType", new object[]
                {
                    matEvent.contentType
                });
            }
            if (matEvent.contentId != null)
            {
                androidJavaObject = androidJavaObject.Call <AndroidJavaObject>("withContentId", new object[]
                {
                    matEvent.contentId
                });
            }
            int?level = matEvent.level;

            if (level.HasValue)
            {
                androidJavaObject = androidJavaObject.Call <AndroidJavaObject>("withLevel", new object[]
                {
                    matEvent.level
                });
            }
            int?quantity2 = matEvent.quantity;

            if (quantity2.HasValue)
            {
                androidJavaObject = androidJavaObject.Call <AndroidJavaObject>("withQuantity", new object[]
                {
                    matEvent.quantity
                });
            }
            if (matEvent.searchString != null)
            {
                androidJavaObject = androidJavaObject.Call <AndroidJavaObject>("withSearchString", new object[]
                {
                    matEvent.searchString
                });
            }
            DateTime?date = matEvent.date1;

            if (date.HasValue)
            {
                DateTime?         date2             = matEvent.date1;
                TimeSpan          timeSpan          = new TimeSpan(date2.Value.Ticks);
                double            totalMilliseconds = timeSpan.TotalMilliseconds;
                DateTime          dateTime          = new DateTime(1970, 1, 1);
                double            arg_465_0         = totalMilliseconds;
                TimeSpan          timeSpan2         = new TimeSpan(dateTime.Ticks);
                double            num = arg_465_0 - timeSpan2.TotalMilliseconds;
                AndroidJavaObject androidJavaObject4 = new AndroidJavaObject("java.lang.Double", new object[]
                {
                    num
                });
                long num2 = androidJavaObject4.Call <long>("longValue", new object[0]);
                AndroidJavaObject androidJavaObject5 = new AndroidJavaObject("java.util.Date", new object[]
                {
                    num2
                });
                androidJavaObject = androidJavaObject.Call <AndroidJavaObject>("withDate1", new object[]
                {
                    androidJavaObject5
                });
            }
            DateTime?date3 = matEvent.date2;

            if (date3.HasValue)
            {
                DateTime?         date4              = matEvent.date2;
                TimeSpan          timeSpan3          = new TimeSpan(date4.Value.Ticks);
                double            totalMilliseconds2 = timeSpan3.TotalMilliseconds;
                DateTime          dateTime2          = new DateTime(1970, 1, 1);
                double            arg_52E_0          = totalMilliseconds2;
                TimeSpan          timeSpan4          = new TimeSpan(dateTime2.Ticks);
                double            num3 = arg_52E_0 - timeSpan4.TotalMilliseconds;
                AndroidJavaObject androidJavaObject6 = new AndroidJavaObject("java.lang.Double", new object[]
                {
                    num3
                });
                long num4 = androidJavaObject6.Call <long>("longValue", new object[0]);
                AndroidJavaObject androidJavaObject7 = new AndroidJavaObject("java.util.Date", new object[]
                {
                    num4
                });
                androidJavaObject = androidJavaObject.Call <AndroidJavaObject>("withDate2", new object[]
                {
                    androidJavaObject7
                });
            }
            if (matEvent.attribute1 != null)
            {
                androidJavaObject = androidJavaObject.Call <AndroidJavaObject>("withAttribute1", new object[]
                {
                    matEvent.attribute1
                });
            }
            if (matEvent.attribute2 != null)
            {
                androidJavaObject = androidJavaObject.Call <AndroidJavaObject>("withAttribute2", new object[]
                {
                    matEvent.attribute2
                });
            }
            if (matEvent.attribute3 != null)
            {
                androidJavaObject = androidJavaObject.Call <AndroidJavaObject>("withAttribute3", new object[]
                {
                    matEvent.attribute3
                });
            }
            if (matEvent.attribute4 != null)
            {
                androidJavaObject = androidJavaObject.Call <AndroidJavaObject>("withAttribute4", new object[]
                {
                    matEvent.attribute4
                });
            }
            if (matEvent.attribute5 != null)
            {
                androidJavaObject = androidJavaObject.Call <AndroidJavaObject>("withAttribute5", new object[]
                {
                    matEvent.attribute5
                });
            }
            return(androidJavaObject);
        }
 public MATItemIos(MATItem matItem)
 {
     this.name       = matItem.name;
     this.unitPrice  = matItem.unitPrice ?? 0;
     this.quantity   = matItem.quantity ?? 0;
     this.revenue    = matItem.revenue ?? 0;
     this.attribute1 = matItem.attribute1;
     this.attribute2 = matItem.attribute2;
     this.attribute3 = matItem.attribute3;
     this.attribute4 = matItem.attribute4;
     this.attribute5 = matItem.attribute5;
 }