void onWin() { level += 1; lives += 1; score += 1000; if (level < 11) { for (int i = 0; i < 49; i++) { blocks.Remove(blocks[0]); } LevelLoad(level); findStart(); } else { //Change to the name screen Form f = this.FindForm(); HowTo hs = new HowTo(); f.Controls.Add(hs); hs.Location = new Point((f.Width - hs.Width) / 2, (f.Height - hs.Height) / 2); hs.Focus(); f.Controls.Remove(this); } }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } HowTo = await _context.HowTos.FindAsync(id); if (HowTo != null) { var path = HowTo.File; _context.HowTos.Remove(HowTo); await _context.SaveChangesAsync(); var rootFolder = _env.WebRootPath; if (System.IO.File.Exists(Path.Combine(rootFolder, path))) { System.IO.File.Delete(Path.Combine(rootFolder, path)); } } return(RedirectToPage("./Index")); }
public IHttpActionResult UpdateHowTo(HowTo howTo) { try { if (howTo.Id == 0) { return(BadRequest("Du har inte angett vilket KB som du vill uppdatera!")); } else { new Database().SqlUpdateHowTo(howTo); return(Ok(new Database().SqlGetAllHowTos().Where(x => x.Id == howTo.Id).FirstOrDefault())); } } catch (Exception e) { string msg = "Object reference not set to an instance of an object."; if (e.Message == msg) { return(BadRequest("Du har inte matat in något värde alls!")); } else { return(Content(HttpStatusCode.Forbidden, "Error code: " + e.Message)); } } }
private void AddRecipient(string email, HowTo howTo) { var recipient = new MapiRecipDesc { recipClass = (int)howTo, name = email }; _mRecipients.Add(recipient); }
bool AddRecipient(string email, HowTo howTo) { MapiRecipDesc recipient = new MapiRecipDesc { recipClass = (int)howTo, name = email }; m_recipients.Add(recipient); return true; }
bool AddRecipient(string email, HowTo howTo) { MapiRecipDesc recipient = new MapiRecipDesc(); recipient.recipClass = (int)howTo; recipient.name = email; m_recipients.Add(recipient); return(true); }
/// <summary> /// Add recipients to the email /// <param name="_Email">The email</param> /// <param name="_HowTo">Which type of recipient</param> /// <returns>True if the operation went well, false otherwise</returns> /// </summary> bool Add_Recipient(string _Email, HowTo _HowTo) { MapiRecipDesc recipient = new MapiRecipDesc(); recipient.recipClass = (int)_HowTo; recipient.name = _Email; m_Recipients.Add(recipient); return(true); }
private bool AddRecipient(String email, HowTo howTo) { MapiRecipDesc recipient = new MapiRecipDesc(); recipient.RecipClass = (int)howTo; recipient.Name = email; _recipients.Add(recipient); return(true); }
private void Play_Click(object sender, EventArgs e) { //Change to the how to play screen Form f = this.FindForm(); HowTo hs = new HowTo(); f.Controls.Add(hs); hs.Location = new Point((f.Width - hs.Width) / 2, (f.Height - hs.Height) / 2); hs.Focus(); f.Controls.Remove(this); }
bool AddRecipient(string email, HowTo howTo) { MapiRecipDesc recipient = new MapiRecipDesc(); recipient.recipClass = (int)howTo; recipient.name = email; // Note: For Outlook Express it would be better to also set recipient.address so that it // shows the email address in the confirmation dialog, but this messes up things in // Outlook and Windows Mail. m_recipients.Add(recipient); return true; }
bool AddRecipient(string email, HowTo howTo) { MapiRecipDesc recipient = new MapiRecipDesc(); recipient.recipClass = (int)howTo; recipient.name = email; // Note: For Outlook Express it would be better to also set recipient.address so that it // shows the email address in the confirmation dialog, but this messes up things in // Outlook and Windows Mail. m_recipients.Add(recipient); return(true); }
private CookingStrategy LoadStrategy(HowTo strat) { switch (strat) { case HowTo.Cook: return(new CookStrategy(this)); case HowTo.Bake: return(new BakeStrategy(this)); default: throw new NotSupportedException("I have no idea how to cook!"); } }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } HowTo = await _context.HowTos.FirstOrDefaultAsync(m => m.Id == id); if (HowTo == null) { return(NotFound()); } return(Page()); }
public IHttpActionResult AddHowTo(HowTo howTo) { try { new Database().SqlAddHowTo(howTo); return(Ok(new Database().SqlGetAllHowTos().OrderByDescending(x => x.Created).FirstOrDefault())); } catch (Exception e) { string msg = "Object reference not set to an instance of an object."; if (e.Message == msg) { return(BadRequest("Du har inte matat in något värde alls!")); } else { return(Content(HttpStatusCode.Forbidden, "Error code: " + e.Message)); } } }
private bool AddRecipient(String email, HowTo howTo) { MapiRecipDesc recipient = new MapiRecipDesc(); recipient.RecipClass = (int)howTo; recipient.Name = email; _recipients.Add(recipient); return true; }
private bool AddRecipient(string email, HowTo howTo) { var recipient = new MapiRecipDesc(); recipient.recipClass = (int) howTo; recipient.name = email; m_recipients.Add(recipient); return true; }
public Perform(HowTo howTo, double left, double right) { this.howTo = howTo; this.left = left; this.right = right; }
public string MakeFavouriteDish(HowTo strat) { LoadStrategy(strat); return(_strategy.Cook()); }