Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="row"></param>
        /// <param name="type"></param>
        /// <param name="listEx"></param>
        protected static void setListType(int row, property_types type, ListViewEx listEx, string [] listValue)
        {
            string[] strBoolean = { "True", "False" };

            switch (type)
            {
            case property_types.ptInteger:
            case property_types.ptDouble:
            case property_types.ptString:   listEx.AddEditableCell(row, 1);
                break;

            case property_types.ptBoolean:
                listEx.AddComboBoxCell(row, 1, strBoolean);
                break;

            case property_types.ptList:
                listEx.AddComboBoxCell(row, 1, listValue);
                break;
            }
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="row"></param>
        /// <param name="type"></param>
        /// <param name="listEx"></param>
        /// <param name="value"></param>
        protected static void setListValue(int row, property_types type, ListView listEx, object value)
        {
            switch (type)
            {
            case property_types.ptInteger:  listEx.Items[row].SubItems[1].Text = String.Format("{0:D}", Convert.ToInt32(value));
                break;

            case property_types.ptDouble:
                listEx.Items[row].SubItems[1].Text = String.Format("{0:F}", value);
                break;

            case property_types.ptString:
                listEx.Items[row].SubItems[1].Text = Convert.ToString(value);
                break;

            case property_types.ptBoolean:
                listEx.Items[row].SubItems[1].Text = Convert.ToString(value);
                break;

            case property_types.ptList:
                listEx.Items[row].SubItems[1].Text = Convert.ToString(value);
                break;
            }
        }