Azavea.NijPredictivePolicing.AcsAlchemistGui.MainForm.PopulateControls C# (CSharp) Method

PopulateControls() protected method

Copies a 'job instance' onto our form
protected PopulateControls ( ) : void
return void
        protected void PopulateControls()
        {
            this.errorProvider1.Clear();

            var importObj = FormController.Instance.JobInstance;

            cboYear.Text = importObj.Year;                                          //1
            cboStates.SelectedItem = importObj.State;                               //2
            cboSummaryLevel.SelectedItem = Utilities.GetAs<BoundaryLevels>(importObj.SummaryLevel, BoundaryLevels.None);   //3
            txtVariableFilePath.Text = (importObj.IncludedVariableFile + string.Empty).Trim('\"');   //4
            txtOutputDirectory.Text = importObj.OutputFolder;                       //5
            txtWorkingDirectory.Text = importObj.WorkingFolder;                     //6

            if (string.IsNullOrEmpty(importObj.OutputProjection))
            {
                radioDefaultSRID.Checked = true;
            }
            else if (File.Exists(importObj.OutputProjection))
            {
                radioSRIDFile.Checked = true;
                this.txtPrjFilePath.Text = importObj.OutputProjection;
            }
            else
            {
                radioSRIDFromList.Checked = true;
                this.cboProjections.Text = importObj.OutputProjection;
            }

            ////job name:
            txtJobName.Text = importObj.JobName;
            chkReplaceJob.Checked = (string.IsNullOrEmpty(importObj.ReusePreviousJobTable));

            //nothing to do here
            //importObj.ExportToShapefile = (!isFishnet) ? "true" : string.Empty;

            //fishnet:
            txtFishnetCellSize.Text = importObj.ExportToGrid;
            txtFishnetEnvelopeFilePath.Text = importObj.GridEnvelope;

            //this applies to both shapefile and fishnet exports (despite its name)
            cboIncludeEmptyGeom.Checked = (!string.IsNullOrEmpty(importObj.IncludeEmptyGridCells));

            //clip bounds
            txtBoundaryShpFilePath.Text = importObj.ExportFilterShapefile;

            //optional flags
            chkPreserveJamValues.Checked = (!string.IsNullOrEmpty(importObj.PreserveJam));
            chkStripExtraGeoID.Checked = (!string.IsNullOrEmpty(importObj.AddStrippedGEOIDcolumn));
            //TODO: AddGeometryAttributesToOutput (Default is true)

            //reset the progress bar
            pgbStatus.Value = 0;

            this.IsDirty = false;
        }