public async Task EmailPost() { /* * public string sender_email { get; set; } * public string sender_name { get; set; } * public string receiver_email { get; set; } * public string receiver_name { get; set; } * public string message { get; set; } * public string personal_message { get; set; } */ Email myemail = new Email { //Will definitely have to change this if this ever gets implemented as a real project // or else Ill be getting emails. Funny thought sender_email = "*****@*****.**", sender_name = "Bilbo Baggins", receiver_email = "*****@*****.**", receiver_name = "Frodo Baggins", message = "This is a test message coming at you from Visual Studio! Hello world!", personal_message = "And heres a little something personal ;)" }; VDAGateway gateway = new VDAGateway(); HttpResponseMessage response = await gateway.EmailAction(myemail); string errmsg = $"Expecting response [{System.Net.HttpStatusCode.OK}] :: Received [{response.StatusCode}]"; Assert.AreEqual(response.StatusCode, System.Net.HttpStatusCode.OK); }
} //Constructor public override void ViewDidLoad() { base.ViewDidLoad(); List <Kpi> rnkpi = new List <Kpi>(); VDAGateway = new VDAGateway(); if (neededKpi != null && relatedKpi != null) { rnkpi = neededKpi; //Sets list to all the needkPIs } //Initialize table view and its source TableSource = new KPITableModel(rnkpi, relatedKpi); //Passing in needed list and related kpi seperately _table = new UITableView { Frame = new CoreGraphics.CGRect(0, 0, View.Bounds.Width, View.Bounds.Height), Source = TableSource }; //To get rid of table seperator lines _table.SeparatorStyle = UITableViewCellSeparatorStyle.None; //Set background color for the whole table _table.BackgroundColor = UIColor.White; View.AddSubview(_table); TableSource.NewPageEvent += KpiSelected; }
public override void ViewDidLoad() { //Welcome alert var welcomecontroller = UIAlertController.Create("Welcome", "I am your Virtual Dealership Adviser", UIAlertControllerStyle.Alert); welcomecontroller.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, null)); PresentViewController(welcomecontroller, true, null); vdaGateway = new VDAGateway(); //Instance of transition between controller views resetTexts(); //Text should be empty when first accessing MainViewController //Create a tap gesture for movign the keyboard when touching outside of it var g = new UITapGestureRecognizer(() => View.EndEditing(true)); g.CancelsTouchesInView = true; //for iOS5 View.AddGestureRecognizer(g); // Keyboard popup NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.DidShowNotification, KeyBoardUpNotification); // Keyboard Down NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.WillHideNotification, KeyBoardDownNotification); base.ViewDidLoad(); DealershipNameLabel.Text = login_info.dealer_name; //Assign attributes of label DealershipNameLabel.LineBreakMode = UILineBreakMode.WordWrap; Querybox.Placeholder = "Your question..."; YouAskedLabel.TextAlignment = UITextAlignment.Center; //Assign attributes of label YouAskedLabel.LineBreakMode = UILineBreakMode.WordWrap; initSpeakerButton(); HomeSubmitButton.TouchDown += ProcessQuery; Querybox.ValueChanged += (sender, e) => final_query = Querybox.Text; Querybox.EditingDidEnd += delegate { final_query = Querybox.Text; }; }
public override void ViewDidLoad() { base.ViewDidLoad(); //While working in UsernameTextfield, remove keyboard by clicking return this.UsernameTextfield.ShouldReturn += (textField) => { textField.ResignFirstResponder(); return(true); }; //While working in UsernameTextfield, remove keyboard by clicking return this.PasswordTextfield.ShouldReturn += (textField) => { textField.ResignFirstResponder(); return(true); }; PasswordTextfield.SecureTextEntry = true; //Keyboard dismissed on clicking anywhere outside var g = new UITapGestureRecognizer(() => View.EndEditing(true)); g.CancelsTouchesInView = true; View.AddGestureRecognizer(g); //Add the tapping gesture to view //Moving keyboard up and down // Keyboard Goes up NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.DidShowNotification, KeyBoardUpNotification); // Keyboard Dismissed NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.WillHideNotification, KeyBoardDownNotification); vdaGateway = new VDAGateway(); //Instance of transition between controller views LoginButton.TouchDown += LoginRequested; }