コード例 #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Loads a table with the properties found in the CmObject class.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private static void LoadCmObjectProperties()
        {
            LCMClass clsProps = GetLCMClassProperties("CmObject");

            CmObjectProperties = new List <string>();
            foreach (LCMClassProperty prop in clsProps.Properties)
            {
                CmObjectProperties.Add(prop.Name);
            }

            CmObjectProperties.Sort((x, y) => x.CompareTo(y));
        }
コード例 #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Clones this instance.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public LCMClass Clone()
        {
            // Make copies of all the class' properties.
            List <LCMClassProperty> props = new List <LCMClassProperty>();

            foreach (LCMClassProperty clsProp in Properties)
            {
                props.Add(new LCMClassProperty {
                    Name = clsProp.Name, Displayed = clsProp.Displayed
                });
            }

            LCMClass cls = new LCMClass(m_classType);

            cls.Properties = props;
            return(cls);
        }
コード例 #3
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;
        }