public void ParameterizeToolbarSearchButton()
{
_toolStripSearchBtn1.Visible = AddinSettings.IsShowQueryButton;
_toolStripSearchBtn2.Visible = AddinSettings.IsShowQueryButton;
_toolStripSearchBtn3.Visible = AddinSettings.IsShowQueryButton;
_toolStripSearchBtn4.Visible = AddinSettings.IsShowQueryButton;
_toolStripSearchBtn5.Visible = AddinSettings.IsShowQueryButton;
for (int pos = 0; pos < AddinSettings.ButtonsConfigSearch.Length; pos++)
{
bool empty = false;
const string defaultHelptext = "Free Model Searches, Model Search not parametrized.";
string buttonText = "";
string helpText = defaultHelptext;
if (AddinSettings.ButtonsConfigSearch[pos] != null)
{
EaAddinShortcutSearch search = (EaAddinShortcutSearch)AddinSettings.ButtonsConfigSearch[pos];
{
if (search.IsEmpty())
{
empty = true;
}
else
{
buttonText = search.KeyText;
helpText = search.HelpTextLong;
}
}
}
switch (pos)
{
case 0:
_toolStripSearchBtn1.Visible = ! empty;
_toolStripSearchBtn1.Text = buttonText;
_toolStripSearchBtn1.ToolTipText = helpText;
break;
case 1:
_toolStripSearchBtn2.Visible = !empty;
_toolStripSearchBtn2.Text = buttonText;
_toolStripSearchBtn2.ToolTipText = helpText;
break;
case 2:
_toolStripSearchBtn3.Visible = !empty;
_toolStripSearchBtn3.Text = buttonText;
_toolStripSearchBtn3.ToolTipText = helpText;
break;
case 3:
_toolStripSearchBtn4.Visible = !empty;
_toolStripSearchBtn4.Text = buttonText;
_toolStripSearchBtn4.ToolTipText = helpText;
break;
case 4:
_toolStripSearchBtn5.Visible = !empty;
_toolStripSearchBtn5.Text = buttonText;
_toolStripSearchBtn5.ToolTipText = helpText;
break;
}
}
}
#endregion