public frmFISProperties(string fisFilePath) { InitializeComponent(); FISLibraryItem = new FISLibraryItem(fisFilePath, ErrorCalculation.FIS.FISLibrary.FISLibraryItemTypes.User); cmdOK.Text = Properties.Resources.CreateButtonText; IsEditMode = false; }
public frmFISProperties(FISLibraryItem item) { InitializeComponent(); FISLibraryItem = item; IsEditMode = true; if (item.FISType == ErrorCalculation.FIS.FISLibrary.FISLibraryItemTypes.System) { cmdOK.Visible = false; cmdCancel.Text = "Close"; txtName.ReadOnly = true; txtOutputName.ReadOnly = true; txtOutputUnits.ReadOnly = true; txtOutputDescription.ReadOnly = true; cmdEditFISFile.Enabled = false; grdPublications.ReadOnly = true; grdInputs.ReadOnly = true; grdMetaData.ReadOnly = true; grdDatasets.ReadOnly = true; txtDescription.ReadOnly = true; } else { cmdOK.Text = Properties.Resources.UpdateButtonText; } }
private void cboFIS_SelectedIndexChanged(System.Object sender, System.EventArgs e) { if (cboFIS.SelectedIndex < 0) { ErrSurfProperty.FISRuleFile = null; ErrSurfProperty.FISInputs.Clear(); grdFISInputs.DataSource = null; return; } FISLibraryItem selectedFIS = cboFIS.SelectedItem as FISLibraryItem; // Detect if this is already the identified FIS if (!(ErrSurfProperty.FISRuleFile is FISLibraryItem && string.Compare(ErrSurfProperty.FISRuleFile.FilePath.FullName, selectedFIS.FilePath.FullName, true) == 0)) { // Load the inputs for the newly selected FIS rule file into the error properties ErrSurfProperty.FISRuleFile = selectedFIS; ErrSurfProperty.FISInputs.Clear(); foreach (FISInputMeta input in selectedFIS.Inputs) { ErrSurfProperty.FISInputs.Add(new FISInput(input.Name)); } } grdFISInputs.DataSource = ErrSurfProperty.FISInputs; cmdFISProperties.Enabled = rdoFIS.Checked && cboFIS.SelectedItem is FISLibraryItem; // Select the inputs grid to speed up user input grdFISInputs.Select(); if (grdFISInputs.Rows.Count > 0) { grdFISInputs.Rows[0].Cells[1].Selected = true; } }
private void btnDeleteFIS_Click(System.Object sender, System.EventArgs e) { if (MessageBox.Show("Are you sure you want to remove the selected FIS file from the GCD Software? Note that this will not delete the associated *.fis file.", Properties.Resources.ApplicationNameLong, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { FISLibraryItem item = (FISLibraryItem)grdFIS.SelectedRows[0].DataBoundItem; ProjectManager.FISLibrary.FISItems.Remove(item); ProjectManager.FISLibrary.Save(); } }
private void btnEditFIS_Click(System.Object sender, System.EventArgs e) { FISLibraryItem item = (FISLibraryItem)grdFIS.SelectedRows[0].DataBoundItem; frmFISProperties frm = new frmFISProperties(item); if (frm.ShowDialog() == DialogResult.OK) { ProjectManager.FISLibrary.FISItems.ResetBindings(); } }