/// <summary> /// Validating user inputs /// </summary> private bool ValidateParameters() { if (string.IsNullOrWhiteSpace(UrlText.Text)) { MessageBox.Show("Please enter SharePoint Url value."); UrlText.Focus(); return(false); } if (string.IsNullOrWhiteSpace(UserText.Text)) { MessageBox.Show("Please enter User value."); UserText.Focus(); return(false); } if (string.IsNullOrWhiteSpace(PasswordText.Text)) { MessageBox.Show("Please enter Password."); PasswordText.Focus(); return(false); } return(true); }
//implement methods public override void InputFormFields() { WaitForEditorToDisplay(); WaitForFrameToDisplay(); WaitForBodyToDisplay(); WaitForPanelToDisplay(); UrlText.SendKeys(Data.Url); TitleText.SendKeys(Data.Title); }
private void UrlText_Validating(object sender, CancelEventArgs e) { bool result = Uri.TryCreate(UrlText.Text, UriKind.Absolute, out var uriResult) && (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps); if (!result) { e.Cancel = true; UrlText.Select(0, UrlText.Text.Length); ErrorProvider.SetError(UrlText, "Invalid Url"); } }
void ReleaseDesignerOutlets() { if (UrlText != null) { UrlText.Dispose(); UrlText = null; } if (ValidateButton != null) { ValidateButton.Dispose(); ValidateButton = null; } }
void OnScanUrlReuslt(string url) { if (!string.IsNullOrEmpty(url)) { //if (Uri.IsWellFormedUriString(url, UriKind.Absolute)) { ButtonOK.GetComponent <Button>().interactable = true; UrlText.GetComponent <Text>().text = url; gameObject.GetComponent <AudioSource>().Play(); MessageText.GetComponent <Text>().text = "Air Tap Okay Button to play"; LastUrl = url; } } }
private async void SaveFunc() { if (!UrlText.Equals("") && !NameText.Equals("") && !DescriptionText.Equals("")) { using (var db = new PrototypingContext()) { Prototype findPrototype = db.Prototypes.Single(p => p.PrototypeId == prototype.PrototypeId); findPrototype.Url = UrlText; findPrototype.Name = NameText; findPrototype.Description = DescriptionText; db.Prototypes.Update(findPrototype); db.SaveChanges(); } GoBackFunc(); } else { var message = new MessageDialog("Please fill in all the fields."); await message.ShowAsync(); } }
private async void CreateFunc() { if (!UrlText.Equals("") && !NameText.Equals("") && !DescriptionText.Equals("")) { using (var db = new PrototypingContext()) { db.Prototypes.Add(new Prototype() { Name = NameText, Url = UrlText, Description = DescriptionText, CreatedDate = DateTime.Now }); db.SaveChanges(); } GoBackFunc(); } else { var message = new MessageDialog("Please fill in all the fields."); await message.ShowAsync(); } }
private void UrlText_TextChanged(object sender, TextChangedEventArgs e) { UrlText.ClearValue(BorderBrushProperty); }