void InterlinDocForAnalysis_RightMouseClickedEvent(SimpleRootSite sender, FwRightMouseClickEventArgs e)
{
e.EventHandled = true;
// for the moment we always claim to have handled it.
ContextMenuStrip menu = new ContextMenuStrip();
// Add spelling items if any (i.e., if we clicked a squiggle word).
int hvoObj, tagAnchor;
if (GetTagAndObjForOnePropSelection(e.Selection, out hvoObj, out tagAnchor) &&
(tagAnchor == SegmentTags.kflidFreeTranslation || tagAnchor == SegmentTags.kflidLiteralTranslation ||
tagAnchor == NoteTags.kflidContent))
{
var helper = new SpellCheckHelper(Cache);
helper.MakeSpellCheckMenuOptions(e.MouseLocation, this, menu);
}
int hvoNote;
if (CanDeleteNote(e.Selection, out hvoNote))
{
if (menu.Items.Count > 0)
{
menu.Items.Add(new ToolStripSeparator());
}
// Add the delete item.
string sMenuText = ITextStrings.ksDeleteNote;
ToolStripMenuItem item = new ToolStripMenuItem(sMenuText);
item.Click += OnDeleteNote;
menu.Items.Add(item);
}
if (menu.Items.Count > 0)
{
e.Selection.Install();
menu.Show(this, e.MouseLocation);
}
}