示例#1
0
        private void RefreshControlElementValue(DataGridViewRowCollection rows, int propertyIndex,
                                                DataGridViewCellEventArgs eventArgs)
        {
            if (_isInternalRefreshOperation || 1 == eventArgs.ColumnIndex || eventArgs.RowIndex < 0)
            {
                return;
            }
            DataGridViewRow    rowData        = rows[eventArgs.RowIndex];
            string             controlName    = rowData.Cells[1].Value.ToString();
            ViewControlElement controlElement = GetViewControlElement(controlName);
            bool   isSelected    = (bool)rowData.Cells[0].Value;
            object propertyValue = isSelected ? rowData.Cells[2].Value : null;

            controlElement.SetValue(listBox_stateNames.Text, ViewControlElement.PropertyNames[propertyIndex],
                                    propertyValue);
            RefreshSelectAllState();
        }
示例#2
0
        public ViewControlElement Clone()
        {
            ViewControlElement cloneObj = new ViewControlElement(_control);

            foreach (string key in _values.Keys)
            {
                if (null == _values[key])
                {
                    continue;
                }
                for (int i = 0; i < PropertyNames.Length; i++)
                {
                    cloneObj.SetValue(key, PropertyNames[i], _values[key][i]);
                }
            }
            return(null);
        }