Skip to content

Commit 66553c9

Browse files
committed
2 parents 98cbf92 + bddad91 commit 66553c9

File tree

14 files changed

+369
-38
lines changed

14 files changed

+369
-38
lines changed

InfoBox.Designer/CodeGeneration/CSharpGenerator.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public class CSharpGenerator : ICodeGenerator
3838
/// <param name="useAutoClose">if set to <c>true</c> [use auto close].</param>
3939
/// <param name="autoClose">The auto-close parameters.</param>
4040
/// <param name="design">The design.</param>
41+
/// <param name="fontParameters">The font parameters.</param>
4142
/// <param name="titleStyle">The title style.</param>
4243
/// <param name="titleIconFileName">Filename of the title icon .</param>
4344
/// <param name="opacity">The opacity.</param>
@@ -67,6 +68,7 @@ public string GenerateSingleCall(InformationBoxBehavior behavior,
6768
bool useAutoClose,
6869
AutoCloseParameters autoClose,
6970
DesignParameters design,
71+
FontParameters fontParameters,
7072
InformationBoxTitleIconStyle titleStyle,
7173
string titleIconFileName,
7274
InformationBoxOpacity opacity,
@@ -222,6 +224,12 @@ public string GenerateSingleCall(InformationBoxBehavior behavior,
222224
codeBuilder.AppendFormat(CultureInfo.InvariantCulture, "design: new DesignParameters(System.Drawing.Color.FromArgb({0},{1},{2}), System.Drawing.Color.FromArgb({3},{4},{5})), ", design.FormBackColor.R, design.FormBackColor.G, design.FormBackColor.B, design.BarsBackColor.R, design.BarsBackColor.G, design.BarsBackColor.B);
223225
}
224226

227+
if (null != fontParameters && fontParameters.MessageFont != null)
228+
{
229+
codeBuilder.AppendFormat(CultureInfo.InvariantCulture, "fontParameters: new FontParameters(new System.Drawing.Font(\"{0}\", {1}F)), ",
230+
fontParameters.MessageFont.Name, fontParameters.MessageFont.Size);
231+
}
232+
225233
if (titleStyle == InformationBoxTitleIconStyle.Custom)
226234
{
227235
codeBuilder.AppendFormat(CultureInfo.InvariantCulture, "titleIcon: new InformationBoxTitleIcon(@\"{0}\"), ", titleIconFileName);

InfoBox.Designer/CodeGeneration/ICodeGenerator.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public interface ICodeGenerator
3030
/// <param name="useAutoClose">if set to <c>true</c> [use auto close].</param>
3131
/// <param name="autoClose">The auto-close parameters.</param>
3232
/// <param name="design">The design.</param>
33+
/// <param name="fontParameters">The font parameters.</param>
3334
/// <param name="titleStyle">The title style.</param>
3435
/// <param name="titleIconFileName">Filename of the title icon .</param>
3536
/// <param name="opacity">The opacity.</param>
@@ -59,6 +60,7 @@ string GenerateSingleCall(InformationBoxBehavior behavior,
5960
bool useAutoClose,
6061
AutoCloseParameters autoClose,
6162
DesignParameters design,
63+
FontParameters fontParameters,
6264
InformationBoxTitleIconStyle titleStyle,
6365
string titleIconFileName,
6466
InformationBoxOpacity opacity,

InfoBox.Designer/CodeGeneration/VbNetGenerator.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@ public class VbNetGenerator : ICodeGenerator
3434
/// <param name="useAutoClose">if set to <c>true</c> [use auto close].</param>
3535
/// <param name="autoClose">The auto-close parameters.</param>
3636
/// <param name="design">The design.</param>
37+
/// <param name="fontParameters">The font parameters.</param>
3738
/// <param name="titleStyle">The title style.</param>
3839
/// <param name="titleIconFileName">Filename of the title icon .</param>
3940
/// <param name="opacity">The opacity.</param>
4041
/// <param name="order">The order.</param>
4142
/// <param name="sound">The sound.</param>
4243
/// <returns></returns>
43-
public string GenerateSingleCall(InformationBoxBehavior behavior, string text, string title, InformationBoxButtons buttons, string button1Text, string button2Text, string button3Text, InformationBoxIcon icon, string iconFileName, InformationBoxDefaultButton defaultButton, InformationBoxButtonsLayout buttonsLayout, InformationBoxAutoSizeMode autoSize, InformationBoxPosition position, bool showHelp, string helpFile, string helpTopic, System.Windows.Forms.HelpNavigator navigator, InformationBoxCheckBox checkState, string doNotShowAgainText, InformationBoxStyle style, bool useAutoClose, AutoCloseParameters autoClose, DesignParameters design, InformationBoxTitleIconStyle titleStyle, string titleIconFileName, InformationBoxOpacity opacity, InformationBoxOrder order, InformationBoxSound sound)
44+
public string GenerateSingleCall(InformationBoxBehavior behavior, string text, string title, InformationBoxButtons buttons, string button1Text, string button2Text, string button3Text, InformationBoxIcon icon, string iconFileName, InformationBoxDefaultButton defaultButton, InformationBoxButtonsLayout buttonsLayout, InformationBoxAutoSizeMode autoSize, InformationBoxPosition position, bool showHelp, string helpFile, string helpTopic, System.Windows.Forms.HelpNavigator navigator, InformationBoxCheckBox checkState, string doNotShowAgainText, InformationBoxStyle style, bool useAutoClose, AutoCloseParameters autoClose, DesignParameters design, FontParameters fontParameters, InformationBoxTitleIconStyle titleStyle, string titleIconFileName, InformationBoxOpacity opacity, InformationBoxOrder order, InformationBoxSound sound)
4445
{
4546
StringBuilder codeBuilder = new StringBuilder();
4647
if (checkState == 0)
@@ -191,6 +192,12 @@ public string GenerateSingleCall(InformationBoxBehavior behavior, string text, s
191192
codeBuilder.AppendFormat(CultureInfo.InvariantCulture, "New DesignParameters(Color.FromArgb({0},{1},{2}), Color.FromArgb({3},{4},{5})), ", design.FormBackColor.R, design.FormBackColor.G, design.FormBackColor.B, design.BarsBackColor.R, design.BarsBackColor.G, design.BarsBackColor.B);
192193
}
193194

195+
if (null != fontParameters && fontParameters.MessageFont != null)
196+
{
197+
codeBuilder.AppendFormat(CultureInfo.InvariantCulture, "New FontParameters(New Font(\"{0}\", {1}F)), ",
198+
fontParameters.MessageFont.Name, fontParameters.MessageFont.Size);
199+
}
200+
194201
if (titleStyle == InformationBoxTitleIconStyle.Custom)
195202
{
196203
codeBuilder.AppendFormat(CultureInfo.InvariantCulture, "New InformationBoxTitleIcon(@\"{0}\"), ", titleIconFileName);

0 commit comments

Comments
 (0)