IBugReportService.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. namespace SRDebugger.Services
  3. {
  4. public delegate void BugReportCompleteCallback(bool didSucceed, string errorMessage);
  5. public delegate void BugReportProgressCallback(float progress);
  6. public interface IBugReportService
  7. {
  8. /// <summary>
  9. /// Whether the bug reporter is available for use right now.
  10. /// </summary>
  11. bool IsUsable { get; }
  12. /// <summary>
  13. /// Set the handler that will submit bug reports.
  14. /// </summary>
  15. void SetHandler(IBugReporterHandler handler);
  16. /// <summary>
  17. /// Submit a bug report.
  18. /// completeHandler can be invoked any time after the method is called
  19. /// (even before the method has returned in case of no internet).
  20. /// </summary>
  21. /// <param name="report">Bug report to send</param>
  22. /// <param name="completeHandler">Delegate to call once bug report is submitted successfully</param>
  23. /// <param name="progressCallback">Optionally provide a callback for when progress % is known</param>
  24. void SendBugReport(BugReport report, BugReportCompleteCallback completeHandler,
  25. IProgress<float> progressCallback = null);
  26. }
  27. }