コード例 #1
0
 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);
 }
コード例 #2
0
 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;
 }
コード例 #3
0
        async Task ViewTodoList(ButtonRow arg)
        {
            var todoList = arg.Tag as TodoList;

            await ShowListViewPage(todoList);
        }
コード例 #4
0
 Task Open(ButtonRow arg)
 {
     UIApp.OpenUrl(new Uri(_uri));
     return(Task.CompletedTask);
 }
コード例 #5
0
 Task Copy(ButtonRow button)
 {
     UIApp.CopyToClipboard(_uri);
     return(Task.CompletedTask);
 }
コード例 #6
0
        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();
        }
コード例 #7
0
 async Task Start(ButtonRow button)
 {
     await Task.Delay(0);
 }
コード例 #8
0
 async Task AddFile(ButtonRow button)
 {
     await VerificationFilePage.Open(this, null);
 }
コード例 #9
0
 async Task NewChainKey(ButtonRow button)
 {
     await Navigation.PushAsync(new ChainKeyPage(this, _chainKeys));
 }
コード例 #10
0
        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();
        }
コード例 #11
0
 async Task Chain(ButtonRow button)
 {
     await Navigation.PushAsync(new Chain.ChainOverviewPage());
 }
コード例 #12
0
 async Task Profile(ButtonRow button)
 {
     await Navigation.PushAsync(new Profile.ProfilePage());
 }
コード例 #13
0
 async Task Purchase(ButtonRow button)
 {
     await Navigation.PushAsync(new BuyPurchasePage());
 }
コード例 #14
0
 async Task Join(ButtonRow button)
 {
     await Navigation.PushAsync(new JoinChainPage());
 }
コード例 #15
0
 async Task HandleRequest(ButtonRow button)
 {
     await Navigation.PushAsync(new HandleRequestPage());
 }
コード例 #16
0
 async Task RequestRevenue(ButtonRow arg)
 {
     await Navigation.PushAsync(new RequestRevenuePage());
 }
コード例 #17
0
        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();
            }
        }
コード例 #18
0
 async Task NewEndPoint(ButtonRow button)
 {
     await Navigation.PushAsync(new EndpointPage(this, _endPoints));
 }
コード例 #19
0
 Task Share(ButtonRow button)
 {
     UIApp.Share(_request);
     return(Task.CompletedTask);
 }
コード例 #20
0
 async Task NewPurchase(ButtonRow button)
 {
     await Navigation.PushAsync(new PurchasePage(this, _purchases));
 }
コード例 #21
0
 async Task Close(ButtonRow button)
 {
     await UIApp.Current.PopModal(this);
 }
コード例 #22
0
        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);
        }
コード例 #23
0
 async Task Invite(ButtonRow button)
 {
     await Navigation.PushAsync(new InvitationPage(_todoList.ServiceNode, _todoList.ListId));
 }
コード例 #24
0
 async Task NewChain(ButtonRow button)
 {
     await Navigation.PushAsync(new ChainPage(null, null));
 }
コード例 #25
0
 Task Share(ButtonRow button)
 {
     UIApp.Share(_uri);
     return(Task.CompletedTask);
 }
コード例 #26
0
 async Task ImportKey(ButtonRow button)
 {
     await Navigation.PushAsync(new ImportAccountPage(KeyStoreTypes.Chain, WalletApp.MinPasswordLength, WalletApp.ImportAccount, 1));
 }
コード例 #27
0
 async Task NewTask(ButtonRow arg)
 {
     await MenuPage.ShowPage((page) => page is AddTodoTaskPage, () => new AddTodoTaskPage(null));
 }
コード例 #28
0
 Task Refresh(ButtonRow button)
 {
     Download();
     return(Task.CompletedTask);
 }
コード例 #29
0
 async Task NewTodoList(ButtonRow arg)
 {
     await MenuPage.ShowPage(typeof(NewTodoListPage));
 }
コード例 #30
0
 Task More(ButtonRow button)
 {
     Download(true);
     return(Task.CompletedTask);
 }
コード例 #31
0
 async Task ShowReceiver(ButtonRow button)
 {
     var receiver = long.Parse(_receiver.Edit.Text);
     await Navigation.PushAsync(new ViewProfilePage(receiver));
 }
コード例 #32
0
 async Task Transfer(ButtonRow button)
 {
     await Navigation.PushAsync(new TransferPage());
 }