/// <summary>
/// Displays the abbreviation dialog box that allows
/// the user to either edit or delete an abbreviation
/// </summary>
/// <param name="operation">type of operation - edit/add/delete</param>
private void editOrAddAbbreviation(AbbrOperation operation)
{
var dlg = Context.AppPanelManager.CreatePanel("AbbreviationEditorForm");
if (dlg == null)
{
return;
}
var invoker = (dlg as IExtension).GetInvoker();
invoker.SetValue("InputAbbreviation", operation.InputAbbreviation);
invoker.SetValue("Add", operation.Add);
_abbrForm.Pause();
Context.AppPanelManager.ShowDialog(Context.AppPanelManager.GetCurrentPanel(), dlg as IPanel);
_abbrForm.Resume();
bool?canceled = invoker.GetBoolValue("Cancel");
var outputAbbreviation = invoker.GetValue("OutputAbbreviation") as Abbreviation;
if (outputAbbreviation != null)
{
bool?deleted = invoker.GetBoolValue("Delete");
if (deleted != null)
{
operation.Cancel = canceled.Value;
operation.Delete = deleted.Value;
}
operation.OutputAbbreviation = outputAbbreviation;
}
}