示例#1
0
 /// ------------------------------------------------------------------------------------
 /// <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;
         LCMClassProperty           prop  = cells[2].Value as LCMClassProperty;
         if (LCMClassList.IsCmObjectProperty(prop.Name))
         {
             e.CellStyle.ForeColor = SystemColors.GrayText;
         }
     }
 }
示例#2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Handles the SelectionChangeCommitted event of the cboClass control.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private void cboClass_SelectionChangeCommitted(object sender, EventArgs e)
        {
            LCMClass clsProps = cboClass.SelectedItem as LCMClass;

            lblMsg.Text = string.Format(m_fmtMsg, clsProps.ClassName);
            gridProperties.CellValueChanged -= gridProperties_CellValueChanged;
            gridProperties.Rows.Clear();

            foreach (LCMClassProperty prop in clsProps.Properties)
            {
                bool fIsDisplayedCmObjProp =
                    (m_showCmObjProps || !LCMClassList.IsCmObjectProperty(prop.Name));

                int i = gridProperties.Rows.Add(prop.Displayed && fIsDisplayedCmObjProp, prop.Name, prop);
                gridProperties.Rows[i].ReadOnly = !fIsDisplayedCmObjProp;
            }

            gridProperties.CellValueChanged += gridProperties_CellValueChanged;
        }
示例#3
0
 /// ------------------------------------------------------------------------------------
 /// <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.
     LCMClassList.Reset();
     Close();
 }
示例#4
0
 /// ------------------------------------------------------------------------------------
 /// <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)
 {
     LCMClassList.Save();
     Close();
 }