コード例 #1
0
        async Task InboxChanged(InboxNameRecordInfo info)
        {
            var keyIndex = info.KeyIndex;
            var friend   = _node.GetFriend(_friendAccountId);

            if (friend == null)
            {
                await ErrorAsync("NotFriends");

                return;
            }

            var success = _node.GenerateSubmitAccounts(_friendAccountId, keyIndex);

            RemoveHeaderSection("Inbox");
            AddIndex = GetRow("SelectInboxFooter");
            AddIndex = AddHeaderRow("Inbox");

            var row = AddRow(new SubmitAccountButtonRow <MessageSubmitAccount>(this, () => _node.ServiceNode.GetSubmitAccounts <MessageSubmitAccount>((su) => su.FriendAccountId == _friendAccountId && su.FriendKeyIndex == keyIndex), $"friend-{_friendAccountId}-{keyIndex}"));

            AddIndex = row;

            row.SelectionChanged = InboxChanged;
            row.Tag = info;

            AddIndex = AddInfoRow("InboxInfo");

            AddFooterRow();

            await InboxChanged(row);
        }
コード例 #2
0
        public EditInboxPage(MessageNode node, InboxNameRecordInfo inboxItem) : base("EditInboxPage")
        {
            Subscribe <InboxRenameEvent>(InboxRenamed);

            _node      = node;
            _inboxItem = inboxItem;
            _title     = inboxItem.Title;

            AddTitleRow("Title");

            AddHeaderRow("RenameHeader");

            _titleRow = AddEntryRow(_title, "RenameEntry");

            Status.Add(_titleRow.Edit, T("RenameStatus"), (sv, edit, newText, oldText) =>
            {
                if (!string.IsNullOrEmpty(newText) && newText.Length <= MessageServiceInfo.MaxInboxNameLength && newText != _title)
                {
                    return(true);
                }

                return(false);
            });

            AddSubmitRow("RenameButton", Rename);

            AddFooterRow();
        }