AdjustBuildRevision, FlexMsgBx, Formats, LBWordLib, VlnStatus, RoAccessToSql, TablePicker, VG
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
//using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
|
||||
@@ -121,10 +119,7 @@ namespace JR.Utils.GUI.Forms
|
||||
/// </summary>
|
||||
/// <param name="text">The text.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(string text)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(null, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
public static DialogResult Show(string text) => FlexibleMessageBoxForm.Show(null, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -132,10 +127,7 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="owner">The owner.</param>
|
||||
/// <param name="text">The text.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(IWin32Window owner, string text)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(owner, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
public static DialogResult Show(IWin32Window owner, string text) => FlexibleMessageBoxForm.Show(owner, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -143,10 +135,7 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="text">The text.</param>
|
||||
/// <param name="caption">The caption.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(string text, string caption)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(null, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
public static DialogResult Show(string text, string caption) => FlexibleMessageBoxForm.Show(null, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -155,10 +144,7 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="text">The text.</param>
|
||||
/// <param name="caption">The caption.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(owner, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption) => FlexibleMessageBoxForm.Show(owner, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -167,10 +153,7 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="caption">The caption.</param>
|
||||
/// <param name="buttons">The buttons.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(null, text, caption, buttons, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons) => FlexibleMessageBoxForm.Show(null, text, caption, buttons, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -180,10 +163,7 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="caption">The caption.</param>
|
||||
/// <param name="buttons">The buttons.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(owner, text, caption, buttons, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons) => FlexibleMessageBoxForm.Show(owner, text, caption, buttons, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -193,10 +173,7 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="buttons">The buttons.</param>
|
||||
/// <param name="icon">The icon.</param>
|
||||
/// <returns></returns>
|
||||
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(null, text, caption, buttons, icon, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon) => FlexibleMessageBoxForm.Show(null, text, caption, buttons, icon, MessageBoxDefaultButton.Button1);
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -207,10 +184,7 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="buttons">The buttons.</param>
|
||||
/// <param name="icon">The icon.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(owner, text, caption, buttons, icon, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon) => FlexibleMessageBoxForm.Show(owner, text, caption, buttons, icon, MessageBoxDefaultButton.Button1);
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -221,10 +195,7 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="icon">The icon.</param>
|
||||
/// <param name="defaultButton">The default button.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(null, text, caption, buttons, icon, defaultButton);
|
||||
}
|
||||
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton) => FlexibleMessageBoxForm.Show(null, text, caption, buttons, icon, defaultButton);
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -236,10 +207,7 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="icon">The icon.</param>
|
||||
/// <param name="defaultButton">The default button.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(owner, text, caption, buttons, icon, defaultButton);
|
||||
}
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton) => FlexibleMessageBoxForm.Show(owner, text, caption, buttons, icon, defaultButton);
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -251,10 +219,8 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="icon">The icon.</param>
|
||||
/// <param name="defaultButton">The default button.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult ShowCustom(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
|
||||
{
|
||||
return FlexibleMessageBoxForm.ShowCustom(null, text, caption, buttons, icon);
|
||||
}
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping owner for legacy reasons")]
|
||||
public static DialogResult ShowCustom(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon) => FlexibleMessageBoxForm.ShowCustom(null, text, caption, buttons, icon);
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -341,7 +307,7 @@ namespace JR.Utils.GUI.Forms
|
||||
this.richTextBoxMessage.TabIndex = 0;
|
||||
this.richTextBoxMessage.TabStop = false;
|
||||
this.richTextBoxMessage.Text = "<Message>";
|
||||
this.richTextBoxMessage.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.richTextBoxMessage_LinkClicked);
|
||||
this.richTextBoxMessage.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.RichTextBoxMessage_LinkClicked);
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
@@ -431,8 +397,8 @@ namespace JR.Utils.GUI.Forms
|
||||
#region Private constants
|
||||
|
||||
//These separators are used for the "copy to clipboard" standard operation, triggered by Ctrl + C (behavior and clipboard format is like in a standard MessageBox)
|
||||
private static readonly String STANDARD_MESSAGEBOX_SEPARATOR_LINES = "---------------------------\n";
|
||||
private static readonly String STANDARD_MESSAGEBOX_SEPARATOR_SPACES = " ";
|
||||
private static readonly string STANDARD_MESSAGEBOX_SEPARATOR_LINES = "---------------------------\n";
|
||||
private static readonly string STANDARD_MESSAGEBOX_SEPARATOR_SPACES = " ";
|
||||
|
||||
//These are the possible buttons (in a standard MessageBox)
|
||||
private enum ButtonID { OK = 0, CANCEL, YES, NO, ABORT, RETRY, IGNORE, OVERWRITE, RENAME };
|
||||
@@ -440,10 +406,10 @@ namespace JR.Utils.GUI.Forms
|
||||
//These are the buttons texts for different languages.
|
||||
//If you want to add a new language, add it here and in the GetButtonText-Function
|
||||
private enum TwoLetterISOLanguageID { en, de, es, it };
|
||||
private static readonly String[] BUTTON_TEXTS_ENGLISH_EN = { "OK", "Cancel", "&Yes", "&No", "&Abort", "&Retry", "&Ignore", "&Overwrite", "&Rename" }; //Note: This is also the fallback language
|
||||
private static readonly String[] BUTTON_TEXTS_GERMAN_DE = { "OK", "Abbrechen", "&Ja", "&Nein", "&Abbrechen", "&Wiederholen", "&Ignorieren", "&Overwrite", "&Rename" };
|
||||
private static readonly String[] BUTTON_TEXTS_SPANISH_ES = { "Aceptar", "Cancelar", "&Sí", "&No", "&Abortar", "&Reintentar", "&Ignorar", "&Overwrite", "&Rename" };
|
||||
private static readonly String[] BUTTON_TEXTS_ITALIAN_IT = { "OK", "Annulla", "&Sì", "&No", "&Interrompi", "&Riprova", "&Ignora", "&Overwrite", "&Rename" };
|
||||
private static readonly string[] BUTTON_TEXTS_ENGLISH_EN = { "OK", "Cancel", "&Yes", "&No", "&Abort", "&Retry", "&Ignore", "&Overwrite", "&Rename" }; //Note: This is also the fallback language
|
||||
private static readonly string[] BUTTON_TEXTS_GERMAN_DE = { "OK", "Abbrechen", "&Ja", "&Nein", "&Abbrechen", "&Wiederholen", "&Ignorieren", "&Overwrite", "&Rename" };
|
||||
private static readonly string[] BUTTON_TEXTS_SPANISH_ES = { "Aceptar", "Cancelar", "&Sí", "&No", "&Abortar", "&Reintentar", "&Ignorar", "&Overwrite", "&Rename" };
|
||||
private static readonly string[] BUTTON_TEXTS_ITALIAN_IT = { "OK", "Annulla", "&Sì", "&No", "&Interrompi", "&Riprova", "&Ignora", "&Overwrite", "&Rename" };
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -451,7 +417,7 @@ namespace JR.Utils.GUI.Forms
|
||||
|
||||
private MessageBoxDefaultButton defaultButton;
|
||||
private int visibleButtonsCount;
|
||||
private TwoLetterISOLanguageID languageID = TwoLetterISOLanguageID.en;
|
||||
private readonly TwoLetterISOLanguageID languageID = TwoLetterISOLanguageID.en;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -758,9 +724,9 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
|
||||
private void FlexibleMessageBoxForm_Shown(object sender, EventArgs e)
|
||||
{
|
||||
int buttonIndexToFocus = 1;
|
||||
Button buttonToFocus;
|
||||
|
||||
int buttonIndexToFocus;
|
||||
//Set the default button...
|
||||
switch (this.defaultButton)
|
||||
{
|
||||
@@ -799,7 +765,7 @@ namespace JR.Utils.GUI.Forms
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="System.Windows.Forms.LinkClickedEventArgs"/> instance containing the event data.</param>
|
||||
private void richTextBoxMessage_LinkClicked(object sender, LinkClickedEventArgs e)
|
||||
private void RichTextBoxMessage_LinkClicked(object sender, LinkClickedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -877,12 +843,14 @@ namespace JR.Utils.GUI.Forms
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
|
||||
{
|
||||
//Create a new instance of the FlexibleMessageBox form
|
||||
var flexibleMessageBoxForm = new FlexibleMessageBoxForm();
|
||||
flexibleMessageBoxForm.ShowInTaskbar = false;
|
||||
var flexibleMessageBoxForm = new FlexibleMessageBoxForm
|
||||
{
|
||||
ShowInTaskbar = false,
|
||||
|
||||
//Bind the caption and the message text
|
||||
flexibleMessageBoxForm.CaptionText = caption;
|
||||
flexibleMessageBoxForm.MessageText = text;
|
||||
//Bind the caption and the message text
|
||||
CaptionText = caption,
|
||||
MessageText = text
|
||||
};
|
||||
flexibleMessageBoxForm.FlexibleMessageBoxFormBindingSource.DataSource = flexibleMessageBoxForm;
|
||||
|
||||
//Set the buttons visibilities and texts. Also set a default button.
|
||||
@@ -914,15 +882,18 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="icon">The icon.</param>
|
||||
/// <param name="defaultButton">The default button.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping buttons for legacy reasons")]
|
||||
public static DialogResult ShowCustom(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
|
||||
{
|
||||
//Create a new instance of the FlexibleMessageBox form
|
||||
var flexibleMessageBoxForm = new FlexibleMessageBoxForm();
|
||||
flexibleMessageBoxForm.ShowInTaskbar = false;
|
||||
var flexibleMessageBoxForm = new FlexibleMessageBoxForm
|
||||
{
|
||||
ShowInTaskbar = false,
|
||||
|
||||
//Bind the caption and the message text
|
||||
flexibleMessageBoxForm.CaptionText = caption;
|
||||
flexibleMessageBoxForm.MessageText = text;
|
||||
//Bind the caption and the message text
|
||||
CaptionText = caption,
|
||||
MessageText = text
|
||||
};
|
||||
flexibleMessageBoxForm.FlexibleMessageBoxFormBindingSource.DataSource = flexibleMessageBoxForm;
|
||||
|
||||
//Set the buttons visibilities and texts. Also set a default button.
|
||||
|
||||
Reference in New Issue
Block a user