Exemple #1
0
        public static string GetNotification(GetNotificationsObject.Datum item)
        {
            try
            {
                string text = "";
                GetNotificationsObject.Datum check = null;

                switch (item.Type)
                {
                case "visit":
                    text  = Application.Context.GetText(Resource.String.Lbl_VisitYou);
                    check = ListUtils.VisitsList.FirstOrDefault(a => a.Notifier.Id == item.Notifier.Id);
                    if (check == null)
                    {
                        ListUtils.VisitsList.Add(item);
                    }
                    break;

                case "like":
                    text  = Application.Context.GetText(Resource.String.Lbl_LikeYou);
                    check = ListUtils.LikesList.FirstOrDefault(a => a.Notifier.Id == item.Notifier.Id);
                    if (check == null)
                    {
                        ListUtils.LikesList.Add(item);
                    }
                    break;

                case "dislike":
                    text  = Application.Context.GetText(Resource.String.Lbl_DislikeYou);
                    check = ListUtils.LikesList.FirstOrDefault(a => a.Notifier.Id == item.Notifier.Id);
                    if (check == null)
                    {
                        ListUtils.LikesList.Add(item);
                    }
                    break;

                case "send_gift":
                    text = Application.Context.GetText(Resource.String.Lbl_SendGiftToYou);
                    break;

                case "got_new_match":
                    text  = Application.Context.GetText(Resource.String.Lbl_YouGotMatch);
                    check = ListUtils.MatchList.FirstOrDefault(a => a.Notifier.Id == item.Notifier.Id);
                    if (check == null)
                    {
                        ListUtils.MatchList.Add(item);
                    }
                    break;

                default:
                    text = "";
                    break;
                }

                return(text);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return("");
            }
        }
Exemple #2
0
        public static string GetNotificationsText(GetNotificationsObject.Datum item)
        {
            try
            {
                string text;
                switch (item.Type)
                {
                case "visit":
                    text = Application.Context.GetText(Resource.String.Lbl_VisitYou);
                    break;

                case "like":
                    text = Application.Context.GetText(Resource.String.Lbl_LikeYou);
                    break;

                case "dislike":
                    text = Application.Context.GetText(Resource.String.Lbl_DislikeYou);
                    break;

                case "send_gift":
                    text = Application.Context.GetText(Resource.String.Lbl_SendGiftToYou);
                    break;

                case "got_new_match":
                    text = Application.Context.GetText(Resource.String.Lbl_YouGotMatch);
                    break;

                case "message":
                    text = Application.Context.GetText(Resource.String.Lbl_MessageNotifications);
                    break;

                case "approve_receipt":
                    text = Application.Context.GetText(Resource.String.Lbl_ApproveReceipt);
                    break;

                case "disapprove_receipt":
                    text = Application.Context.GetText(Resource.String.Lbl_DisapproveReceipt);
                    break;

                case "accept_chat_request":
                    text = Application.Context.GetText(Resource.String.Lbl_AcceptChatRequest);
                    break;

                case "accept_chdecline_chat_requestat_request":
                    text = Application.Context.GetText(Resource.String.Lbl_DeclineChatRequest);
                    break;

                case "friend_request_accepted":
                    text = Application.Context.GetText(Resource.String.Lbl_FriendRequestAccepted);
                    break;

                case "friend_request":
                    text = Application.Context.GetText(Resource.String.Lbl_FriendRequestYou);
                    break;

                default:
                    text = Methods.FunString.DecodeString(item.Text);
                    break;
                }

                return(text);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return("");
            }
        }