Added methods to use common dictionary of fonts part of B2017-117 Out of Window Handles fix

Use method from VE_Font to get a font reference (uses dictionary so redundant Window Handles are not created)  B2017-117
Add a Using statement when we temporarily create a RichTextBox to ensure the Window Handle is free’d. Also use method from VE_Font to get a font reference (uses dictionary so redundant Window Handles are not created)  B2017-117
This commit is contained in:
2017-06-12 17:57:22 +00:00
parent c630da8c92
commit 74898f5e4e
6 changed files with 262 additions and 161 deletions

View File

@@ -2456,9 +2456,9 @@ namespace Volian.Controls.Library
nextEditItem.Top = newTop;
if (nextEditItem.Top != newTop)
{
_MyLog.InfoFormat("'TryAgainLater',{0},{1},{2},{3},{4},'{5}'",
oldTop, nextEditItem.Top, newTop, MyStepPanel.Height, nextEditItem.MyID, nextEditItem.MyItemInfo.ShortPath);
nextEditItem.TryAgainLater = true;
_MyLog.InfoFormat("'TryAgainLater',{0},{1},{2},{3},{4},'{5}'",
oldTop, nextEditItem.Top, newTop, MyStepPanel.Height, nextEditItem.MyID, nextEditItem.MyItemInfo.ShortPath);
nextEditItem.TryAgainLater = true;
}
nextEditItem.LastMethodsPop();
MyStepPanel.ItemMoving--;
@@ -3694,7 +3694,10 @@ namespace Volian.Controls.Library
foreach (EnhancedDocument ed in MyItemInfo.GetMyEnhancedDocuments())
{
DVEnhancedDocument dved = dveds.GetByType(ed.Type);
Font fnt = new System.Drawing.Font("Arial", 5);
// follow through in fixing an Out of Window Handles bug, use new function to see if
// we can retrieve the font from a dictionary instead a doing a New and using another
// window handle B2017-117
Font fnt = VE_Font.GetWinSysFont("Arial", 5);
//g.DrawLine(Pens.DarkGreen, 18, 1, 18, 6);
//g.DrawLine(Pens.DarkGreen, 18, 1, 21, 1);
//g.DrawLine(Pens.DarkGreen, 18, 3, 21, 3);