This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (e.Key == startKey) | |
{ | |
if (handler != null) | |
{ | |
this.isScanning = true; | |
e.Handled = true; | |
} | |
} | |
else if (this.isScanning && e.Key == endKey) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Image DrawText(String text, Font font, Color textColor, Color backColor) | |
{ | |
//first, create a dummy bitmap just to get a graphics object | |
Image img = new Bitmap(1, 1); | |
Graphics drawing = Graphics.FromImage(img); | |
//measure the string to see how big the image needs to be | |
SizeF textSize = drawing.MeasureString(text, font); | |
//free up the dummy image and old graphics object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override int SaveChanges() | |
{ | |
try | |
{ | |
return base.SaveChanges(); | |
} | |
catch (DbEntityValidationException ex) | |
{ | |
// Retrieve the error messages as a list of strings. | |
var errorMessages = ex.EntityValidationErrors |