Beispiel #1
0
        public void AddUpdateFile(VerifyFileJson verifyItem)
        {
            var buttons = GetHeaderSectionRows("Files");

            foreach (var button in buttons)
            {
                if (button.Tag == verifyItem)
                {
                    var v = (button as ButtonRow).RowLayout.Children.Last() as VerifyFileView;
                    v.Update(verifyItem);
                    Status.ReValidate();
                    return;
                }
            }

            AddIndex       = _addButton;
            AddIndexBefore = true;

            var view = new VerifyFileView(true);

            view.Update(verifyItem);

            var newButton = AddButtonViewRow(view, EditFile);

            newButton.Tag = verifyItem;
            Status.AddBusyView(newButton);
            Status.ReValidate();
        }
Beispiel #2
0
        VerificationFilePage(AddVerificationPage verificationPage, VerifyFileJson verifyItem, OpenFile file = null) : base("VerificationFilePage")
        {
            _verificationPage = verificationPage;
            _item             = verifyItem ?? new VerifyFileJson();

            AddTitleRow("Title");
            AddHeaderRow("File");
            Status.AddBusyView(AddButtonRow("Select", Select));

            _link = AddEntryRow(null, "Link");
            _link.SetDetailViewIcon(Icons.RowLink);

            _verifyView = new VerifyFileView(false);
            AddViewRow(_verifyView);

            if (verifyItem != null)
            {
                _link.Edit.Text = verifyItem.link;
                _fileName       = verifyItem.name;
                _fileHash       = verifyItem.GetHash();
                _length         = verifyItem.length;
                _verifyView.Update(verifyItem);
            }

            Status.Add(_link.Edit, T("LinkStatus"), (view, entry, newText, oldText) =>
            {
                if (string.IsNullOrEmpty(newText))
                {
                    return(true);
                }

                return(newText.IsValdiUrl(true));
            });

            Status.Add(T("FileStatus"), (sv) =>
            {
                return(!string.IsNullOrEmpty(_fileName) && _fileHash != null && _length > 0);
            });

            AddFooterRow();

            AddSubmitRow("Submit", Submit);

            if (file != null)
            {
                UIApp.Run(() => HashFile(file));
            }
        }
Beispiel #3
0
        public VerificationFilesPage(VerifyJson verify) : base("VerificationFilesPage")
        {
            AddTitleRow("Title");

            AddHeaderRow();

            foreach (var file in verify.files)
            {
                var view = new VerifyFileView(true);
                view.Update(file);

                var row = AddButtonViewRow(view, Verify);
                row.Tag = file;
            }

            AddFooterRow();
        }