void Start() { control = (Control)FindObjectOfType(typeof(Control)); grid = (Grid)FindObjectOfType(typeof(Grid)); NetworkInterface netIf = (NetworkInterface)FindObjectOfType(typeof(NetworkInterface)); buttonRow = new ButtonRow(control); header = new HeaderBar(control, netIf); }
public static ButtonRow CreateAndroid(IGUIMessages receiver) { ButtonRow row = new ButtonRow(receiver); Rect gameGUIRect = SkillGUI.GetGameGUIRect(); row.position = new Rect(gameGUIRect.x,gameGUIRect.y,gameGUIRect.width,gameGUIRect.height*(40f/110f)); int sector = (int)(gameGUIRect.width/3); int buttonWidth = (int)(sector*0.6f); int timerWidth = sector-buttonWidth; row.p1Clock.position = new Rect(0,0,timerWidth,row.position.height); row.endturn.position = new Rect(timerWidth,0,buttonWidth,row.position.height); row.p2Clock.position = new Rect(row.position.width-timerWidth,0,timerWidth,row.position.height); row.undo.position = new Rect(row.position.width-sector,0,buttonWidth,row.position.height); row.statusField.position = new Rect(sector,0,row.position.width-sector*2,row.position.height); Debug.Log("creating buttonRow in rect: "+row.position); return row; }
async Task ViewTodoList(ButtonRow arg) { var todoList = arg.Tag as TodoList; await ShowListViewPage(todoList); }
Task Open(ButtonRow arg) { UIApp.OpenUrl(new Uri(_uri)); return(Task.CompletedTask); }
Task Copy(ButtonRow button) { UIApp.CopyToClipboard(_uri); return(Task.CompletedTask); }
public TodoTaskPage(TodoList todoList, TodoTask task) : base("TodoTaskPage") { Subscribe <NewTodoTaskEvent>(TodoItem); Subscribe <TodoTaskStatusEvent>(TodoItemStatus); _todoList = todoList; _task = task; AddTitleRow("Title"); AddHeaderRow("StatusHeader"); var statusItems = new SelectionItemList <TodoTaskStatusTypes> { new SelectionItem <TodoTaskStatusTypes>(TodoTaskStatusTypes.Open, Tr.Get("ItemStatusTypes.Open")), new SelectionItem <TodoTaskStatusTypes>(TodoTaskStatusTypes.Closed, Tr.Get("ItemStatusTypes.Closed")) }; _status = AddSelectionRows(statusItems, task.Status); _status.SelectionChanged = StatusChanged; _statusButton = AddSubmitButtonRow("SubmitStatus", StatusButton); _statusButton.RowStyle = Theme.SubmitButton; _statusButton.IsEnabled = false; _status.Buttons[0].SetDetailViewIcon(Icons.Circle); _status.Buttons[1].SetDetailViewIcon(Icons.CircleCheck); foreach (var b in _status.Buttons) { Status.AddBusyView(b); } Status.AddBusyView(_statusButton); AddFooterRow(); if (task.Status == TodoTaskStatusTypes.Open) { AddHeaderRow("ItemHeader"); _text = AddEditorRow(task.Text, "Text"); _text.SetDetailViewIcon(Icons.Pencil); _text.Edit.TextChanged += Edit_TextChanged; _textButton = AddSubmitButtonRow("SubmitText", Submit); _textButton.RowStyle = Theme.SubmitButton; _textButton.IsEnabled = false; Status.AddBusyView(_text.Edit); Status.AddBusyView(_textButton); AddFooterRow(); } _history = AddHeaderRow("HistoryHeader"); AddFooterRow(); _transactionInfo = AddHeaderRow("TransactionInfo"); AddFooterRow(); AddHeaderRow("Common.SubmitAccount"); _submitAccount = AddRow(new SubmitAccountButtonRow <GroupSubmitAccount>(this, () => todoList.ServiceNode.GetSubmitAccounts <GroupSubmitAccount>(todoList.Index), todoList.ListId.ToString())); AddInfoRow("Common.SubmitAccountInfo"); AddFooterRow(); AddHeaderRow("DeleteHeader"); var delete = AddButtonRow("SubmitDelete", Delete); delete.RowStyle = Theme.CancelButton; delete.SetDetailViewIcon(Icons.TrashAlt); Status.AddBusyView(delete); AddFooterRow(); _ = BuildHistory(); }
async Task Start(ButtonRow button) { await Task.Delay(0); }
async Task AddFile(ButtonRow button) { await VerificationFilePage.Open(this, null); }
async Task NewChainKey(ButtonRow button) { await Navigation.PushAsync(new ChainKeyPage(this, _chainKeys)); }
public ChainPage(ChainInfo chainInfo, ChainKeyStore chainKey) : base("ChainPage") { ChainInfo = chainInfo; _chainKey = chainKey; Subscribe <ChainRegistrationEvent>(Chain); if (chainInfo != null) { var endPoints = chainInfo.GetPublicEndpoints(); foreach (var endPoint in endPoints) { _endPoints.Add(new ChainItem <string>(ChainItemStatus.Live, endPoint)); } foreach (var key in chainInfo.GetRevokeableChainKeys()) { _chainKeys.Add(new ChainKeyItem(key.IsRevoked ? ChainItemStatus.Revoked : ChainItemStatus.Live, key.Item)); } foreach (var purchase in chainInfo.GetChainPurchases()) { _purchases.Add(new ChainItem <PurchaseInfo>(purchase.IsRevoked ? ChainItemStatus.Revoked : ChainItemStatus.Live, purchase.Item)); } } AddTitleRow("Title"); AddHeaderRow("Info"); _name = AddEntryRow(null, "Name"); _name.SetDetailViewIcon(Icons.Pencil); if (chainInfo != null) { _name.Edit.Text = chainInfo.Name; } _website = AddEntryRow(null, "Website"); _website.SetDetailViewIcon(Icons.RowLink); if (chainInfo != null) { _website.Edit.Text = chainInfo.Website; } AddFooterRow(); AddHeaderRow("ChainKeys"); _chainKeysButton = AddButtonRow("ChainKeysButton", NewChainKey); Status.AddBusyView(_chainKeysButton); AddFooterRow(); AddHeaderRow("EndPoints"); _endPointsButton = AddButtonRow("EndPointsButton", NewEndPoint); Status.AddBusyView(_endPointsButton); AddFooterRow(); /* * AddHeaderRow("Purchases"); * _purchasesButton = AddButtonRow("PurchasesButton", NewPurchase); * Status.AddBusyView(_purchasesButton); * AddFooterRow(); */ Status.Add(_name.Edit, T("NameStatus"), (view, entry, newText, oldTex) => { if (string.IsNullOrEmpty(newText)) { return(false); } return(true); }). Add(_website.Edit, T("WebsiteStatus"), (view, entry, newText, oldText) => { if (string.IsNullOrEmpty(newText)) { return(true); } return(newText.IsValdiUrl(true)); }); _adminKeyStatus = Status.Add(T("AdminKeyStatus"), (sv) => { foreach (var key in _chainKeys) { if ((key.Status == ChainItemStatus.Live || key.Status == ChainItemStatus.New) && ((key.Item.Flags & PublicChainKeyFlags.ChainAdminKey) != 0)) { return(true); } } return(false); }); _endPointStatus = Status.Add(T("EndPointStatus"), (sv) => { return(_endPoints.Any((a) => a.Status == ChainItemStatus.New || a.Status == ChainItemStatus.Live)); }); AddIndex = AddSubmitRow("Submit", Submit); AddIndexBefore = true; if (_chainKey != null) { _keyPassword = AddPasswordRow("", "KeyPassword"); Status.Add(_keyPassword.Edit, T("PasswordStatus"), (sv, entry, newText, oldText) => { return(_chainKey.IsPasswordValid(newText)); }); } AddIndex = null; AddIndexBefore = false; UpdateChainKeys(); UpdateEndpoints(); UpdatePurchases(); }
async Task Chain(ButtonRow button) { await Navigation.PushAsync(new Chain.ChainOverviewPage()); }
async Task Profile(ButtonRow button) { await Navigation.PushAsync(new Profile.ProfilePage()); }
async Task Purchase(ButtonRow button) { await Navigation.PushAsync(new BuyPurchasePage()); }
async Task Join(ButtonRow button) { await Navigation.PushAsync(new JoinChainPage()); }
async Task HandleRequest(ButtonRow button) { await Navigation.PushAsync(new HandleRequestPage()); }
async Task RequestRevenue(ButtonRow arg) { await Navigation.PushAsync(new RequestRevenuePage()); }
void SetupPage() { StackLayout.Children.Clear(); if (!ServiceNodeManager.Current.HadUnlockedServiceNode) { AddTitleRow("VerifyPage.Title"); AddInfoRow("VerifyInfo"); ServiceNodesPage.AddAuthorizeSection(ServiceNodeManager.Current.NewDefaultServiceNode, this, false); } else { AddTitleRow("Title"); AddHeaderRow("Info"); _description = AddEntryRow(null, "Description"); _description.SetDetailViewIcon(Icons.Pencil); _link = AddEntryRow(null, "Link"); _link.SetDetailViewIcon(Icons.RowLink); Status.Add(_description.Edit, T("DescriptionStatus"), (view, entry, newText, oldTex) => { if (string.IsNullOrEmpty(newText)) { return(false); } return(true); }). Add(_link.Edit, T("LinkStatus"), (view, entry, newText, oldText) => { if (string.IsNullOrEmpty(newText)) { return(true); } return(newText.IsValdiUrl(true)); }); AddFooterRow(); AddHeaderRow("Files"); _addButton = AddButtonRow("AddFile", AddFile); Status.Add(T("FilesStatus"), (sv) => { return(GetVerifyFiles().Count > 0); }); AddFooterRow(); AddSubmitRow("Submit", Submit); AddHeaderRow("Common.SubmitAccount"); _submitAccount = AddRow(new SubmitAccountButtonRow(VerifyApp.Current.GetLastUsedSubmitAccount <SubmitAccount>(), this, SelectSubmitAccount)); AddInfoRow("Common.SubmitAccountInfo"); AddFooterRow(); } }
async Task NewEndPoint(ButtonRow button) { await Navigation.PushAsync(new EndpointPage(this, _endPoints)); }
Task Share(ButtonRow button) { UIApp.Share(_request); return(Task.CompletedTask); }
async Task NewPurchase(ButtonRow button) { await Navigation.PushAsync(new PurchasePage(this, _purchases)); }
async Task Close(ButtonRow button) { await UIApp.Current.PopModal(this); }
Task Submit(ButtonRow button) { var name = _name.Edit.Text; var webSite = _website.Edit.Text; var keys = new List <WalletClient.ChainKey>(); var revokedKeys = new List <short>(); var endPoints = new List <Uri>(); var removedEndPoints = new List <Uri>(); var purchases = new List <PurchaseInfo>(); var revokedPurchases = new List <int>(); foreach (var chainKey in _chainKeys) { if (chainKey.Status == ChainItemStatus.New) { keys.Add(new WalletClient.ChainKey(chainKey.Key, chainKey.Item, chainKey.Name, chainKey.Password)); } else if (chainKey.Status == ChainItemStatus.Revoked) { revokedKeys.Add(chainKey.Item.KeyIndex); } } foreach (var endPoint in _endPoints) { if (endPoint.Status == ChainItemStatus.New) { endPoints.Add(new Uri(endPoint.Item)); } else if (endPoint.Status == ChainItemStatus.Revoked) { removedEndPoints.Add(new Uri(endPoint.Item)); } } foreach (var purchase in _purchases) { if (purchase.Status == ChainItemStatus.New) { purchases.Add(purchase.Item); } else if (purchase.Status == ChainItemStatus.Revoked) { revokedPurchases.Add(purchase.Item.PurchaseItemId); } } if (ChainInfo == null) { _ = WalletApp.RegisterChain(name, webSite, keys.ToArray(), endPoints.ToArray(), purchases.ToArray()); } else { if (keys.Count == 0 && endPoints.Count == 0 && purchases.Count == 0 && revokedKeys.Count == 0 && removedEndPoints.Count == 0 && revokedPurchases.Count == 0) { Message("NoChanges"); return(Task.CompletedTask); } var password = _keyPassword.Edit.Text; _ = WalletApp.UpdateChain(_chainKey, password, name, webSite, keys.ToArray(), endPoints.ToArray(), purchases.ToArray(), revokedKeys.ToArray(), removedEndPoints.ToArray(), revokedPurchases.ToArray()); } IsBusy = true; return(Task.CompletedTask); }
async Task Invite(ButtonRow button) { await Navigation.PushAsync(new InvitationPage(_todoList.ServiceNode, _todoList.ListId)); }
async Task NewChain(ButtonRow button) { await Navigation.PushAsync(new ChainPage(null, null)); }
Task Share(ButtonRow button) { UIApp.Share(_uri); return(Task.CompletedTask); }
async Task ImportKey(ButtonRow button) { await Navigation.PushAsync(new ImportAccountPage(KeyStoreTypes.Chain, WalletApp.MinPasswordLength, WalletApp.ImportAccount, 1)); }
async Task NewTask(ButtonRow arg) { await MenuPage.ShowPage((page) => page is AddTodoTaskPage, () => new AddTodoTaskPage(null)); }
Task Refresh(ButtonRow button) { Download(); return(Task.CompletedTask); }
async Task NewTodoList(ButtonRow arg) { await MenuPage.ShowPage(typeof(NewTodoListPage)); }
Task More(ButtonRow button) { Download(true); return(Task.CompletedTask); }
async Task ShowReceiver(ButtonRow button) { var receiver = long.Parse(_receiver.Edit.Text); await Navigation.PushAsync(new ViewProfilePage(receiver)); }
async Task Transfer(ButtonRow button) { await Navigation.PushAsync(new TransferPage()); }