async Task Profile(ProfileButtonRow button) { if (long.TryParse(_accountId.Edit.Text, out var id)) { await Navigation.PushAsync(new ViewProfilePage(id)); } }
async Task ViewProfile(ProfileButtonRow arg) { var serviceNode = _serviceNode.ServiceNode; var profileData = await ProfileManager.Current.GetProfileData(arg.AccountId, ProfileDownloadType.QueryStoredData, false); await Navigation.PushAsync(new StatusAccountPage(profileData, serviceNode, arg.AccountId, StatusAccountProfileType.Big, 0)); }
async Task ViewMessages(ProfileButtonRow button) { if (button.Tag is SubscriptionInfo info) { await StatusAccountPage.OpenStatusAccountPage(this, info.Subscriptions.Status.ServiceNode, info.AccountId, StatusAccountProfileType.Small); await info.Subscriptions.Status.UpdateLastViewedTransactinInfo(info); (button as StatusProfileButtonRow)?.UpdateMessagesCount(info); } }
async Task OpenChat(ProfileButtonRow arg) { var row = arg as ChatProfileButtonRow; var item = arg.Tag as Chat; var update = item.UpdateLastViewedCount(); await _page.Navigation.PushAsync(new ChatPage(item)); if (update) { row.UpdateMessagesCount(item.LastCount - item.LastViewedCount); await item.Node.SaveAsync(); } }
async Task User(ProfileButtonRow button) { var accountId = button.AccountId; var pending = (bool)button.Tag; var profile = T("Profile"); var remove = T("Remove"); var invite = T("Reinvite"); var items = new List <string> { profile }; if (accountId != _todoList.ServiceNode.AccountId) { items.Add(remove); } if (pending) { items.Add(invite); } var result = await DisplayActionSheet(Tr.Get("Common.Action"), Tr.Get("Common.Cancel"), null, items.ToArray()); if (result == profile) { await Navigation.PushAsync(new ViewProfilePage(accountId)); } else if (result == remove) { if (await ConfirmAsync("DeleteConfirm")) { IsBusy = true; UIApp.Run(() => TodoApp.Current.DeleteListUser(_todoList.ServiceNode.GetSubmitAccounts <SubmitAccount>(TodoServiceInfo.TodoSubmitIndex).FirstOrDefault(), _todoList, accountId)); //_ = HeleusApp.DeleteListUser(_todoList.ListId, user.AccountId); } } else if (result == invite) { await Navigation.PushAsync(new InvitationPage(_todoList.ServiceNode, _todoList.ListId, accountId)); } }
protected override async Task ProfileButton(ProfileButtonRow arg) { await Navigation.PushAsync(new ContactPage(_node, arg.AccountId)); }
async Task ProfileButton(ProfileButtonRow arg) { await StatusAccountPage.OpenStatusAccountPage(this, _serviceNode.ServiceNode, arg.AccountId, StatusAccountProfileType.Big); }
public InvitationPage(ServiceNode serviceNode, long todoListId, long accountId = 0) : base("InvitationPage") { Subscribe <TodoListInvitationSentEvent>(InvitationResult); EnableStatus(); AddTitleRow("Title"); var todo = TodoApp.Current.GetTodo(serviceNode); if (todo.TodoLists.Count == 0) { AddInfoRow("NoLists"); return; } AddHeaderRow("List"); TodoList @default = null; var listSelection = new SelectionItemList <TodoList>(); foreach (var list in todo.TodoLists) { listSelection.Add(new SelectionItem <TodoList>(list, TodoApp.GetTodoListName(list))); if (list.ListId == todoListId) { @default = list; } } _listSelection = AddSelectionRows(listSelection, @default); _listSelection.SelectionChanged = SelectionChanged; Status.Add(T("ListStatus"), (sv) => { return(_listSelection.Selection != null); }); AddFooterRow(); AddHeaderRow("AccountId"); _accountId = AddEntryRow(accountId > 0 ? accountId.ToString() : null, "AccountId"); Status.Add(_accountId.Edit, T("AccountStatus"), (sv, edit, n, o) => { var valid = StatusValidators.PositiveNumberValidator(sv, edit, n, o); if (_profile != null) { _profile.IsEnabled = valid; if (valid) { _profile.AccountId = long.Parse(n); } else { _profile.AccountId = 0; } } return(valid); }); _profile = AddRow(new ProfileButtonRow(0, Profile)); _profile.IsEnabled = accountId > 0; Status.AddBusyView(_profile); AddFooterRow(); AddIndex = AddSubmitRow("Submit", Submit); AddIndexBefore = true; _password = AddPasswordRow("", "Password"); Status.Add(_password.Edit, T("PasswordStatus"), (sv, edit, newtext, oldtext) => true); AddIndex = null; AddIndexBefore = false; AddHeaderRow("Common.SubmitAccount"); _submitAccount = AddRow(new SubmitAccountButtonRow <GroupSubmitAccount>(null, this, SelectSubmitAccount)); AddInfoRow("Common.SubmitAccountInfo"); AddFooterRow(); Status.Add(T("SubmitAccountStatus"), (sv) => { return(_submitAccount.SubmitAccount != null); }); SelectionChanged(@default); }
async Task Confirm(ProfileButtonRow arg) { await Navigation.PushAsync(new ContactPage(_node, arg.AccountId)); }