C# Class Azavea.NijPredictivePolicing.AcsAlchemistGui.MainForm

Datei anzeigen Open project: azavea/acs-alchemist

Protected Properties

Property Type Description
_isDirty bool
_tooltips ToolTip>.Dictionary

Public Methods

Method Description
CheckSave ( ) : bool

Returns false if the following action should be cancelled

MainForm ( ) : System
SmartToggler ( ) : void

Perform all our form enable/disables in one place, so the form is always in a consistent state (this also makes this much easier to maintain)

Protected Methods

Method Description
AddDefaultTooltips ( ) : void
CheckValidity ( bool isFishnet ) : bool

Sanity check to determine if we have enough information to start a job / export -- This function should display a MessageBox if something is really wrong

DisplayException ( string label, Exception ex ) : void

A very basic error display helper -- NOTE! It is up to the developer to choose what exceptions are FATAL or not. This helper is for potentially NON-FATAL exceptions / or those that can be recovered from

Dispose ( bool disposing ) : void

Clean up any resources being used.

FixWeirdStyles ( ) : void

Windows configurations differ in the actual colors used for different elements 'InactiveText', 'BackgroundColor', etc. Our log text is a little 'grayed out' to be less distracting, but on some configurations this can make it invisible.

GatherInputs ( bool isFishnet ) : void

Copies our form onto a 'job instance'

HideLoadingSpinner ( ) : void
LoadFonts ( ) : void

We're doing this because fonts are rarely consistent between machines (in this case, my dev laptop, and my dev workstation). This changes the appearance of the console log, and the controls quite significantly (stuff disappears), so it's pretty important that the font is right.

PopulateControls ( ) : void

Copies a 'job instance' onto our form

PopulateLists ( ) : void

Populates our 'year', 'state', 'summary level', and 'srid' controls, as well as any other "choose from a set" controls that come up.

SetTooltip ( Control ctl, string label ) : void

Helper for setting tooltips

ShowLoadingSpinner ( ) : void
TryRunExport ( bool isFishnet ) : void

Private Methods

Method Description
AddFontMemResourceEx ( IntPtr pbFont, uint cbFont, IntPtr pdv, [ pcFonts ) : IntPtr
InitializeComponent ( ) : void

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

MainForm_Load ( object sender, EventArgs e ) : void

Initialize the controls and whatnot

aboutToolStripMenuItem_Click ( object sender, EventArgs e ) : void
backgroundWorker1_DoWork ( object sender, DoWorkEventArgs e ) : void
backgroundWorker1_ProgressChanged ( object sender, ProgressChangedEventArgs e ) : void

On progress updated

backgroundWorker1_RunWorkerCompleted ( object sender, RunWorkerCompletedEventArgs e ) : void

when we're done, re-enable the form

btnBrowseBoundaryShpFile_Click ( object sender, EventArgs e ) : void

Browse for the "Output Filter Boundary" Shapefile

btnBrowseFishnetEnvelopeFile_Click ( object sender, EventArgs e ) : void

Browse for "Grid boundary-alignment file"

btnBrowseOutputFolder_Click ( object sender, EventArgs e ) : void

Browse for the "Output Folder"

btnBrowsePrjFile_Click ( object sender, EventArgs e ) : void

Browse for the "Output Projection File"

btnBrowseVariableFile_Click ( object sender, EventArgs e ) : void

Opens a file dialog for -- Variables File Extensions: *.txt, *.vars / All

btnBrowseWorking_Click ( object sender, EventArgs e ) : void
btnCancel_Click ( object sender, EventArgs e ) : void
btnFishnet_Click ( object sender, EventArgs e ) : void

Export a fishnet

btnSaveMessageLog_Click ( object sender, EventArgs e ) : void

TODO: This is not yet implemented, providing a helpful error message

btnShapefile_Click ( object sender, EventArgs e ) : void

Export a shapefile using census boundaries!

cboProjections_SelectedIndexChanged ( object sender, EventArgs e ) : void

Sets the projection text as the tooltip, best way we have for showing what projection they've selected

cboProjections_Validating ( object sender, CancelEventArgs e ) : void
cboStates_Validating ( object sender, CancelEventArgs e ) : void
cboSummaryLevel_Validating ( object sender, CancelEventArgs e ) : void
cboYear_Validating ( object sender, CancelEventArgs e ) : void
general_CheckedChanged ( object sender, EventArgs e ) : void
general_SelectedValueChanged ( object sender, EventArgs e ) : void
general_TextChanged ( object sender, EventArgs e ) : void
newJobToolStripMenuItem_Click ( object sender, EventArgs e ) : void
openJobFileToolStripMenuItem_Click ( object sender, EventArgs e ) : void
quitToolStripMenuItem_Click ( object sender, EventArgs e ) : void
radioDefaultSRID_CheckedChanged ( object sender, EventArgs e ) : void
radioSRIDFile_CheckedChanged ( object sender, EventArgs e ) : void
radioSRIDFromList_CheckedChanged ( object sender, EventArgs e ) : void
saveJobFileToolStripMenuItem_Click ( object sender, EventArgs e ) : void
txtFishnetCellSize_Validating ( object sender, CancelEventArgs e ) : void
txtPrjFilePath_Validating ( object sender, CancelEventArgs e ) : void
txtVariableFilePath_Validating ( object sender, CancelEventArgs e ) : void
workOfflineToolStripMenuItem_Click ( object sender, EventArgs e ) : void

Method Details

AddDefaultTooltips() protected method

protected AddDefaultTooltips ( ) : void
return void

CheckSave() public method

Returns false if the following action should be cancelled
public CheckSave ( ) : bool
return bool

CheckValidity() protected method

Sanity check to determine if we have enough information to start a job / export -- This function should display a MessageBox if something is really wrong
protected CheckValidity ( bool isFishnet ) : bool
isFishnet bool
return bool

DisplayException() protected method

A very basic error display helper -- NOTE! It is up to the developer to choose what exceptions are FATAL or not. This helper is for potentially NON-FATAL exceptions / or those that can be recovered from
protected DisplayException ( string label, Exception ex ) : void
label string
ex Exception
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

FixWeirdStyles() protected method

Windows configurations differ in the actual colors used for different elements 'InactiveText', 'BackgroundColor', etc. Our log text is a little 'grayed out' to be less distracting, but on some configurations this can make it invisible.
protected FixWeirdStyles ( ) : void
return void

GatherInputs() protected method

Copies our form onto a 'job instance'
protected GatherInputs ( bool isFishnet ) : void
isFishnet bool
return void

HideLoadingSpinner() protected method

protected HideLoadingSpinner ( ) : void
return void

LoadFonts() protected method

We're doing this because fonts are rarely consistent between machines (in this case, my dev laptop, and my dev workstation). This changes the appearance of the console log, and the controls quite significantly (stuff disappears), so it's pretty important that the font is right.
protected LoadFonts ( ) : void
return void

MainForm() public method

public MainForm ( ) : System
return System

PopulateControls() protected method

Copies a 'job instance' onto our form
protected PopulateControls ( ) : void
return void

PopulateLists() protected method

Populates our 'year', 'state', 'summary level', and 'srid' controls, as well as any other "choose from a set" controls that come up.
protected PopulateLists ( ) : void
return void

SetTooltip() protected method

Helper for setting tooltips
protected SetTooltip ( Control ctl, string label ) : void
ctl Control
label string
return void

ShowLoadingSpinner() protected method

protected ShowLoadingSpinner ( ) : void
return void

SmartToggler() public method

Perform all our form enable/disables in one place, so the form is always in a consistent state (this also makes this much easier to maintain)
public SmartToggler ( ) : void
return void

TryRunExport() protected method

protected TryRunExport ( bool isFishnet ) : void
isFishnet bool
return void

Property Details

_isDirty protected_oe property

protected bool _isDirty
return bool

_tooltips protected_oe property

collection of tooltip controls
protected Dictionary _tooltips
return ToolTip>.Dictionary