PandaWood / ExceptionReporter.NET

ExceptionReporter is a .NET component that gathers detailed information on an Exception and the application/system running it. It allows the user to copy, save or send a custom-formatted report to the developer
MIT License
51 stars 32 forks source link

Feature Request: Please add option to hide the Email button #10

Closed LazyLeecher closed 6 years ago

LazyLeecher commented 6 years ago

Some times I don't want the option to send emails do be show to the user in both screens (More/Less Details). Less headache.

Great lib, thanks a lot!

FrancoTampieri commented 6 years ago

I'm agree too

PandaWood commented 6 years ago

Yes, agreed. Just depends on the product. I'll see if I can work this in

FrancoTampieri commented 6 years ago

If u want I can fork project and give u an hand with a PR.

PandaWood commented 6 years ago

@drdran Yes by all means create a PR if you can. I'm on a Mac at home so can't easily test the UI of ExceptionReporter (which doesn't really work very well in Mono for some reason)

PandaWood commented 6 years ago

Post Script: this can now also be achieved by setting the config SendMethod to ReportSendMethod.None - ShowEmailButton is left in for backward compatibility - and will override the aforementioned setting if both are set

See this fairly exhaustive set of test cases

[TestCase(ReportSendMethod.None, true,       ExpectedResult = false)]
[TestCase(ReportSendMethod.SMTP, true,       ExpectedResult = true)]
[TestCase(ReportSendMethod.SMTP, false,      ExpectedResult = false)]
[TestCase(ReportSendMethod.SimpleMAPI, true, ExpectedResult = true)]
[TestCase(ReportSendMethod.WebService, true, ExpectedResult = true)]
public bool Can_Determine_ShowEmailButton(ReportSendMethod method, bool show)
{
    _info.SendMethod = method;
    _info.ShowEmailButton = show;
    return _info.ShowEmailButton;
}