C# Class Bloom.MiscUI.ProblemReporterDialog

This dialog lets users bring up an issue with us. It can include a description, a screenshot, and the file they were working on. It can try to send directly via internet. If this fails, it can make a single zip file and direct the user to email that to us.
Inheritance: System.Windows.Forms.Form
Show file Open project: BloomBooks/BloomDesktop Class Usage Examples

Public Properties

Property Type Description
Book Book.Book

Protected Properties

Property Type Description
_description System.Windows.Forms.TextBox
_state State
_youTrackProjectKey string

Public Methods

Method Description
IsLegalEmail ( string emailAddress ) : bool
ProblemReporterDialog ( ) : System
ProblemReporterDialog ( Control targetOfScreenshot ) : System
ProblemReporterDialog ( Control targetOfScreenshot, BookSelection bookSelection ) : System
SetDefaultIncludeBookSetting ( bool include ) : void

Protected Methods

Method Description
ChangeState ( State state ) : void
Dispose ( bool disposing ) : void

Clean up any resources being used.

OnHandleCreated ( EventArgs e ) : void
UpdateDisplay ( ) : void
_okButton_Click ( object sender, EventArgs e ) : void

Private Methods

Method Description
AddAttachment ( string file ) : void
GetAdditionalEnvironmentInfo ( StringBuilder bldr ) : void
GetFullDescriptionContents ( bool appendLog ) : string
GetLogFile ( ) : TempFile
GetScreenshot ( Control targetOfScreenshot ) : void
GetStandardErrorReportingProperties ( StringBuilder bldr, bool appendLog ) : void
InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

MakeEmailableReportFile ( ) : void

If we are able to directly submit to YouTrack, we do that. But otherwise, this makes a zip file of everything we want to submit, in order to give the user a single thing they need to attach and send.

MakePackageForUserToEmail ( ) : void
ProblemReporterDialog_Load ( object sender, EventArgs e ) : void
Startup ( object sender, EventArgs e ) : void
SubmitToYouTrack ( ) : bool

Using YouTrackSharp here. We can't submit the report as if it were from this person, even if they have an account (well, not without asking them for credentials, which is just not gonna happen). So we submit with an account we created just for this purpose, "auto_report_creator".

UpdateDisplay ( object sender, EventArgs e ) : void
_cancelButton_Click ( object sender, EventArgs e ) : void
_privacyLabel_LinkClicked ( object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e ) : void
_seeDetails_LinkClicked ( object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e ) : void

Method Details

ChangeState() protected method

protected ChangeState ( State state ) : void
state State
return void

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void

IsLegalEmail() public method

public IsLegalEmail ( string emailAddress ) : bool
emailAddress string
return bool

OnHandleCreated() protected method

protected OnHandleCreated ( EventArgs e ) : void
e System.EventArgs
return void

ProblemReporterDialog() public method

public ProblemReporterDialog ( ) : System
return System

ProblemReporterDialog() public method

public ProblemReporterDialog ( Control targetOfScreenshot ) : System
targetOfScreenshot System.Windows.Forms.Control
return System

ProblemReporterDialog() public method

public ProblemReporterDialog ( Control targetOfScreenshot, BookSelection bookSelection ) : System
targetOfScreenshot System.Windows.Forms.Control
bookSelection Bloom.Book.BookSelection
return System

SetDefaultIncludeBookSetting() public method

public SetDefaultIncludeBookSetting ( bool include ) : void
include bool
return void

UpdateDisplay() protected method

protected UpdateDisplay ( ) : void
return void

_okButton_Click() protected method

protected _okButton_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

Property Details

Book public property

public Book.Book Book
return Book.Book

_description protected property

protected System.Windows.Forms.TextBox _description
return System.Windows.Forms.TextBox

_state protected property

protected State _state
return State

_youTrackProjectKey protected property

protected string _youTrackProjectKey
return string