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

@@ -88,6 +88,26 @@ namespace VEPROMS.CSLA.Library
_WinFontLookup.Add(key, new Font(family, size, style));
return _WinFontLookup[key];
}
// part of bug B2017-117 and for conservation of winow handles to reduce the frequency of
// the Out of Window Handles error when editing and printing.
// we are now using a common dictionary for font usages
public static Font GetWinSysFont(string family, float size, FontStyle style)
{
return GetFont(family, size, style);
}
public static Font GetWinSysFont(string family, float size)
{
return GetFont(family, size, FontStyle.Regular);
}
public static Font GetWinSysFont(FontFamily ffamily, float size, FontStyle style)
{
return GetFont(ffamily.Name, size, style);
}
public static Font GetWinSysFont(Font font, FontStyle style)
{
return GetFont(font.Name, font.Size, style);
}
private Font _WindowsFont;
public Font WindowsFont
{