private void GetMultiplierFile(int rowIndex)
        {
            if (!this.m_IsEnabled)
            {
                return;
            }

            DataSheet ds         = this.Scenario.GetDataSheet(Strings.DATASHEET_TRANSITION_SPATIAL_INITIATION_MULTIPLIER_NAME);
            string    RasterFile = RasterUtilities.ChooseRasterFileName("Transition Spatial Initiation Mulitplier Raster File", this);

            if (RasterFile == null)
            {
                return;
            }

            DataGridViewEditMode OldMode = this.m_MultipliersDataGrid.EditMode;

            this.m_MultipliersDataGrid.EditMode = DataGridViewEditMode.EditProgrammatically;

            this.m_MultipliersDataGrid.CurrentCell = this.m_MultipliersDataGrid.Rows[rowIndex].Cells[FILE_NAME_COLUMN_INDEX];
            this.m_MultipliersDataGrid.Rows[rowIndex].Cells[FILE_NAME_COLUMN_INDEX].Value = Path.GetFileName(RasterFile);
            this.m_MultipliersDataGrid.NotifyCurrentCellDirty(true);

            this.m_MultipliersDataGrid.BeginEdit(false);
            this.m_MultipliersDataGrid.EndEdit();

            this.m_MultipliersDataGrid.CurrentCell = this.m_MultipliersDataGrid.Rows[rowIndex].Cells[BROWSE_COLUMN_INDEX];

            ds.AddExternalInputFile(RasterFile);

            this.m_MultipliersDataGrid.EditMode = OldMode;
        }
Esempio n. 2
0
        private void SetICSpatialFile(int rowIndex, int colIndex, string rasterFullFilename)
        {
            try
            {
                this.m_AllowColumnEdits = true;

                using (HourGlass h = new HourGlass())
                {
                    DataSheet            ds      = this.Scenario.GetDataSheet(Strings.DATASHEET_SPIC_NAME);
                    DataGridViewEditMode OldMode = this.m_FilesDataGrid.EditMode;

                    this.m_FilesDataGrid.EditMode    = DataGridViewEditMode.EditProgrammatically;
                    this.m_FilesDataGrid.CurrentCell = this.m_FilesDataGrid.Rows[rowIndex].Cells[colIndex];

                    this.m_FilesDataGrid.BeginEdit(false);
                    this.m_FilesDataGrid.EditingControl.Text = Path.GetFileName(rasterFullFilename);
                    this.m_FilesDataGrid.EndEdit();

                    this.m_FilesDataGrid.CurrentCell = this.m_FilesDataGrid.Rows[rowIndex].Cells[colIndex + 1];
                    this.m_FilesDataGrid.EditMode    = OldMode;

                    ds.AddExternalInputFile(rasterFullFilename);
                }
            }
            finally
            {
                this.m_AllowColumnEdits = false;
            }
        }
Esempio n. 3
0
        private void ButtonChooseTemplate_Click(object sender, System.EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Title  = "Choose File";
            dlg.Filter = "NetLogo Files|*.nlogo";

            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                DataSheet ds = this.DataFeed.GetDataSheet("netlogo_Script");

                ds.AddExternalInputFile(dlg.FileName);
                ds.SetSingleRowData("TemplateFile", Path.GetFileName(dlg.FileName));
                this.RefreshBoundControls();
            }
        }
Esempio n. 4
0
        private void ButtonBrowse_Click(object sender, System.EventArgs e)
        {
            string RasterFile = RasterUtilities.ChooseRasterFileName("Digital Elevation Model File", this);

            if (RasterFile == null)
            {
                return;
            }

            using (HourGlass h = new HourGlass())
            {
                DataSheet ds             = this.GetDataSheet();
                DataRow   dr             = ds.GetDataRow();
                string    RasterFileName = Path.GetFileName(RasterFile);

                if (dr == null)
                {
                    dr = ds.GetData().NewRow();

                    ds.BeginAddRows();
                    dr[Strings.DATASHEET_DIGITAL_ELEVATION_MODEL_FILE_NAME_COLUMN_NAME] = RasterFileName;
                    ds.GetData().Rows.Add(dr);
                    ds.EndAddRows();
                }
                else
                {
                    ds.BeginModifyRows();
                    dr[Strings.DATASHEET_DIGITAL_ELEVATION_MODEL_FILE_NAME_COLUMN_NAME] = RasterFileName;
                    ds.EndModifyRows();
                }

                ds.AddExternalInputFile(RasterFile);

                this.RefreshControls();
                this.EnableButtons();
            }
        }