-
Notifications
You must be signed in to change notification settings - Fork 1
/
UnagiExplorerRibbon.cs
42 lines (39 loc) · 1.51 KB
/
UnagiExplorerRibbon.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using Microsoft.Office.Tools.Ribbon;
using System.Windows.Forms;
using Microsoft.Office.Interop.Outlook;
namespace Unagi
{
public partial class UnagiExplorerRibbon
{
private void UnagiExplorerRibbon_Load(object sender, RibbonUIEventArgs e)
{
if (UnagiConfig.moveReportedToTrash)
{
btnReportPhish.Label = Culture.getText("btnReportDel");
} else {
btnReportPhish.Label = Culture.getText("btnReportNoDel");
}
unagiGroup.Label = Culture.getText("rptBtnGroup");
}
/*
* Check if only one email is selected and if so fire off the report via email action
*/
private void btnReportPhish_Click(object sender, RibbonControlEventArgs e)
{
Selection selection = Globals.ThisAddIn.Application.ActiveExplorer().Selection;
if (selection.Count < 1) // no item is selected
{
MessageBox.Show(Culture.getText("errNoSelection"), "Unagi", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else if (selection.Count > 1) // many items selected
{
MessageBox.Show(Culture.getText("errOnlyOne"), "Unagi", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
ReportMail reportAction = new ReportMail(selection[1]);
reportAction.reportViaMail();
}
}
}
}