//Delete Messages
            private void DeleteItems()
            {
                try
                {
                    if (Timer != null)
                    {
                        Timer.Enabled = true;
                        Timer.Start();
                    }

                    if (TopChatToolBar.Visibility != ViewStates.Visible)
                    {
                        TopChatToolBar.Visibility = ViewStates.Visible;
                    }

                    if (Methods.CheckConnectivity())
                    {
                        List <int> selectedItemPositions = MAdapter.GetSelectedItems();
                        List <int> selectedItemId        = new List <int>();
                        for (int i = selectedItemPositions.Count - 1; i >= 0; i--)
                        {
                            var datItem = MAdapter.GetItem(selectedItemPositions[i]);
                            if (datItem != null)
                            {
                                selectedItemId.Add(datItem.Id);
                                MAdapter.RemoveData(selectedItemPositions[i], datItem);
                            }
                        }

                        //Send Api Delete By id
                        RequestsAsync.Messages.DeleteMessages(Userid.ToString(), selectedItemId).ConfigureAwait(false);

                        MAdapter.NotifyDataSetChanged();
                    }
                    else
                    {
                        Toast.MakeText(Activity, Activity.GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show();
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }
Example #2
0
        public override string ToString()
        {
            this.Init__jsonIgnore();
            string json = string.Concat(
                __jsonIgnore.ContainsKey("Id") ? string.Empty : string.Format(", Id : {0}", Id == null ? "null" : Id.ToString()),
                __jsonIgnore.ContainsKey("Extends") ? string.Empty : string.Format(", Extends : {0}", Extends == null ? "null" : string.Format("'{0}'", Extends.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("Gate") ? string.Empty : string.Format(", Gate : {0}", Gate == null ? "null" : string.Format("'{0}'", Gate.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("Guid") ? string.Empty : string.Format(", Guid : {0}", Guid == null ? "null" : string.Format("'{0}'", Guid.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("Ip") ? string.Empty : string.Format(", Ip : {0}", Ip == null ? "null" : string.Format("'{0}'", Ip.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("Number") ? string.Empty : string.Format(", Number : {0}", Number == null ? "null" : Number.ToString()),
                __jsonIgnore.ContainsKey("Server") ? string.Empty : string.Format(", Server : {0}", Server == null ? "null" : Server.ToString()),
                __jsonIgnore.ContainsKey("Shareid") ? string.Empty : string.Format(", Shareid : {0}", Shareid == null ? "null" : string.Format("'{0}'", Shareid.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("State") ? string.Empty : string.Format(", State : {0}", State == null ? "null" : State.ToString()),
                __jsonIgnore.ContainsKey("Time") ? string.Empty : string.Format(", Time : {0}", Time == null ? "null" : Time.Value.Subtract(new DateTime(1970, 1, 1)).TotalMilliseconds.ToString()),
                __jsonIgnore.ContainsKey("Used_number") ? string.Empty : string.Format(", Used_number : {0}", Used_number == null ? "null" : Used_number.ToString()),
                __jsonIgnore.ContainsKey("Used_userid") ? string.Empty : string.Format(", Used_userid : {0}", Used_userid == null ? "null" : Used_userid.ToString()),
                __jsonIgnore.ContainsKey("Userid") ? string.Empty : string.Format(", Userid : {0}", Userid == null ? "null" : Userid.ToString()), " }");

            return(string.Concat("{", json.Substring(1)));
        }
Example #3
0
        public override string ToString()
        {
            this.Init__jsonIgnore();
            string json = string.Concat(
                __jsonIgnore.ContainsKey("Pkid") ? string.Empty : string.Format(", Pkid : {0}", Pkid == null ? "null" : Pkid.ToString()),
                __jsonIgnore.ContainsKey("Addtime") ? string.Empty : string.Format(", Addtime : {0}", Addtime == null ? "null" : Addtime.Value.Subtract(new DateTime(1970, 1, 1)).TotalMilliseconds.ToString()),
                __jsonIgnore.ContainsKey("Code") ? string.Empty : string.Format(", Code : {0}", Code == null ? "null" : string.Format("'{0}'", Code.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("Gate") ? string.Empty : string.Format(", Gate : {0}", Gate == null ? "null" : string.Format("'{0}'", Gate.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("Mobile") ? string.Empty : string.Format(", Mobile : {0}", Mobile == null ? "null" : string.Format("'{0}'", Mobile.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("Number") ? string.Empty : string.Format(", Number : {0}", Number == null ? "null" : Number.ToString()),
                __jsonIgnore.ContainsKey("Param") ? string.Empty : string.Format(", Param : {0}", Param == null ? "null" : string.Format("'{0}'", Param.Replace("\\", "\\\\").Replace("\r\n", "\\r\\n").Replace("'", "\\'"))),
                __jsonIgnore.ContainsKey("Server") ? string.Empty : string.Format(", Server : {0}", Server == null ? "null" : Server.ToString()),
                __jsonIgnore.ContainsKey("State") ? string.Empty : string.Format(", State : {0}", State == null ? "null" : State.ToString()),
                __jsonIgnore.ContainsKey("Type") ? string.Empty : string.Format(", Type : {0}", Type == null ? "null" : Type.ToString()),
                __jsonIgnore.ContainsKey("Updatetime") ? string.Empty : string.Format(", Updatetime : {0}", Updatetime == null ? "null" : Updatetime.Value.Subtract(new DateTime(1970, 1, 1)).TotalMilliseconds.ToString()),
                __jsonIgnore.ContainsKey("Userid") ? string.Empty : string.Format(", Userid : {0}", Userid == null ? "null" : Userid.ToString()), " }");

            return(string.Concat("{", json.Substring(1)));
        }
Example #4
0
    public override string ToString()
    {
        var  sb      = new StringBuilder("Profile(");
        bool __first = true;

        if (Mid != null && __isset.mid)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Mid: ");
            Mid.ToString(sb);
        }
        if (Userid != null && __isset.userid)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Userid: ");
            Userid.ToString(sb);
        }
        if (Phone != null && __isset.phone)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Phone: ");
            Phone.ToString(sb);
        }
        if (Email != null && __isset.email)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Email: ");
            Email.ToString(sb);
        }
        if (RegionCode != null && __isset.regionCode)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("RegionCode: ");
            RegionCode.ToString(sb);
        }
        if (DisplayName != null && __isset.displayName)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("DisplayName: ");
            DisplayName.ToString(sb);
        }
        if (PhoneticName != null && __isset.phoneticName)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("PhoneticName: ");
            PhoneticName.ToString(sb);
        }
        if (PictureStatus != null && __isset.pictureStatus)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("PictureStatus: ");
            PictureStatus.ToString(sb);
        }
        if (ThumbnailUrl != null && __isset.thumbnailUrl)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("ThumbnailUrl: ");
            ThumbnailUrl.ToString(sb);
        }
        if (StatusMessage != null && __isset.statusMessage)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("StatusMessage: ");
            StatusMessage.ToString(sb);
        }
        if (__isset.allowSearchByUserid)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("AllowSearchByUserid: ");
            AllowSearchByUserid.ToString(sb);
        }
        if (__isset.allowSearchByEmail)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("AllowSearchByEmail: ");
            AllowSearchByEmail.ToString(sb);
        }
        if (PicturePath != null && __isset.picturePath)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("PicturePath: ");
            PicturePath.ToString(sb);
        }
        if (MusicProfile != null && __isset.musicProfile)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("MusicProfile: ");
            MusicProfile.ToString(sb);
        }
        if (VideoProfile != null && __isset.videoProfile)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("VideoProfile: ");
            VideoProfile.ToString(sb);
        }
        sb.Append(")");
        return(sb.ToString());
    }