public static void HandleContent(NSObject content, IContentsListener listener) { if (content.GetType() == typeof(NITContent)) { NITContent cont = (NITContent)content; listener.GotContentNotification(cont); } else if (content.GetType() == typeof(NITSimpleNotification)) { NITSimpleNotification cont = (NITSimpleNotification)content; listener.GotSimpleNotification(cont); } else if (content.GetType() == typeof(NITCoupon)) { NITCoupon cont = (NITCoupon)content; listener.GotCouponNotification(cont); } else if (content.GetType() == typeof(NITCustomJSON)) { NITCustomJSON cont = (NITCustomJSON)content; listener.GotCustomJSONNotification(cont); } else if (content.GetType() == typeof(NITFeedback)) { NITFeedback cont = (NITFeedback)content; listener.GotFeedbackNotification(cont); } }
public override void GotCoupon(NITCoupon Coupon, NITTrackingInfo TrackingInfo) { XCCouponNotification XCoupon = AdapterCoupon.GetCommonType(Coupon); if (NearPCL.GetContentManager() != null) { NearPCL.GetContentManager().GotXCouponNotification(XCoupon); } else { Console.WriteLine("You receive a content but you haven't registered a content manager"); } }
public static XCCouponNotification GetCommonType(NITCoupon CouponNotification) { XCCouponNotification XCoupon = new XCCouponNotification(); XCoupon.NotificationMessage = CouponNotification.NotificationMessage; XCoupon.Description = CouponNotification.Description; XCoupon.Value = CouponNotification.Value; XCoupon.ExpiresAt = CouponNotification.ExpiresAt; XCoupon.RedeemableFrom = CouponNotification.RedeemableFrom; if (CouponNotification.Icon != null) { XCoupon.IconSet = new XCImageSet(); XCoupon.IconSet.FullSize = CouponNotification.Icon.Url.AbsoluteString; XCoupon.IconSet.SmallSize = CouponNotification.Icon.SmallSizeURL.AbsoluteString; } XCoupon.Id = CouponNotification.ID; XCoupon.Serial = CouponNotification.Claims[0].SerialNumber; XCoupon.ClaimedAt = CouponNotification.Claims[0].ClaimedAt; XCoupon.RedeemedAt = CouponNotification.Claims[0].RedeemedAt; return(XCoupon); }