示例#1
0
        public override string TitleForDeleteConfirmation(UITableView tableView, NSIndexPath indexPath)
        {
            ChatListClass toRemove = AppData.currentLST[indexPath.Row];

            if (toRemove.ChatOwner.Uid == AppData.curUser.Uid)
            {
                return("Delete");
            }
            else
            {
                return("Remove");
            }
        }
示例#2
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            UITableViewCell cell = tableView.DequeueReusableCell("chatsCell");

            ChatListClass thisList = AppData.currentLST[indexPath.Row];

            cell.TextLabel.Text = thisList.ChatName;

            string subText = "Owner: " + thisList.ChatOwner.Name;

            cell.DetailTextLabel.Text = subText;

            return(cell);
        }
示例#3
0
        void SaveNewChat(string inputNewChatName)
        {
            ChatListClass newChat = new ChatListClass
            {
                ChatName  = inputNewChatName,
                ChatOwner = AppData.curUser,
                ChatItems = new List <MessageClass>()
            };

            AppData.currentLST.Add(newChat);

            ReadWriteDisk.WriteData();

            SaveListOnCloud.Save(newChat);

            chatsTableView.ReloadData();
        }
示例#4
0
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
        {
            ChatListClass toRemove = AppData.currentLST[indexPath.Row];

            AppData.currentLST.Remove(toRemove);

            if (toRemove.ChatOwner.Uid == AppData.curUser.Uid)
            {
                ReadWriteDisk.WriteData();
                DeleteListFromCloud.Delete(toRemove);
            }
            else
            {
                InvitationClass thisInvitation = new InvitationClass
                {
                    ChatName  = toRemove.ChatName,
                    ChatOwner = toRemove.ChatOwner
                };
                RemoveInvitation.Remove(thisInvitation);
            }

            tableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);
        }