Пример #1
0
        /// <summary>
        /// Adds a row for a integer property
        /// </summary>
        /// <param name="obj">preferences object</param>
        /// <param name="property">the integer property</param>
        /// <param name="attr">descriptor for the property</param>
        private void addIntegerRow(object obj, PropertyInfo property, IntDescriptorAttribute attr)
        {
            String range = attr.MinValue + " to " + attr.MaxValue;

            int rowNum = dataGridView.Rows.Add(property.Name,
                                               attr.Description,
                                               property.GetValue(obj, null).ToString(),
                                               getDefaultValue(property.Name),
                                               range);

            dataGridView.Rows[rowNum].Tag = property;
        }
Пример #2
0
        /// <summary>
        /// Adds a row for a integer field
        /// </summary>
        /// <param name="obj">preferences object</param>
        /// <param name="fieldInfo">the integer field</param>
        /// <param name="attr">descriptor for the field</param>
        private void addIntegerRow(object obj, FieldInfo fieldInfo, IntDescriptorAttribute attr)
        {
            String range = attr.MinValue + " to " + attr.MaxValue;

            int rowNum = dataGridView.Rows.Add(fieldInfo.Name,
                                               attr.Description,
                                               fieldInfo.GetValue(obj).ToString(),
                                               getDefaultValue(fieldInfo.Name),
                                               range);

            dataGridView.Rows[rowNum].Tag = fieldInfo;
        }