/// ------------------------------------------------------------------------------------ /// <summary> /// Handles the CellFormatting event of the gridProperties control. /// </summary> /// ------------------------------------------------------------------------------------ private void gridProperties_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (e.ColumnIndex == 1 && e.RowIndex >= 0 && !m_showCmObjProps) { DataGridViewCellCollection cells = gridProperties.Rows[e.RowIndex].Cells; FDOClassProperty prop = cells[2].Value as FDOClassProperty; if (FDOClassList.IsCmObjectProperty(prop.Name)) { e.CellStyle.ForeColor = SystemColors.GrayText; } } }
/// ------------------------------------------------------------------------------------ /// <summary> /// Handles the SelectionChangeCommitted event of the cboClass control. /// </summary> /// ------------------------------------------------------------------------------------ private void cboClass_SelectionChangeCommitted(object sender, EventArgs e) { FDOClass clsProps = cboClass.SelectedItem as FDOClass; lblMsg.Text = string.Format(m_fmtMsg, clsProps.ClassName); gridProperties.CellValueChanged -= gridProperties_CellValueChanged; gridProperties.Rows.Clear(); foreach (FDOClassProperty prop in clsProps.Properties) { bool fIsDisplayedCmObjProp = (m_showCmObjProps || !FDOClassList.IsCmObjectProperty(prop.Name)); int i = gridProperties.Rows.Add(prop.Displayed && fIsDisplayedCmObjProp, prop.Name, prop); gridProperties.Rows[i].ReadOnly = !fIsDisplayedCmObjProp; } gridProperties.CellValueChanged += gridProperties_CellValueChanged; }
/// ------------------------------------------------------------------------------------ /// <summary> /// Handles the Click event of the btnCancel control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param> /// ------------------------------------------------------------------------------------ private void btnCancel_Click(object sender, EventArgs e) { // This will blow away any changes. FDOClassList.Reset(); Close(); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Handles the Click event of the btnOK control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param> /// ------------------------------------------------------------------------------------ private void btnOK_Click(object sender, EventArgs e) { FDOClassList.Save(); Close(); }