Ejemplo n.º 1
0
        private void LoadField()
        {
            var fieldNode = FieldSetsHelper.FindField(_fieldSetsXml, lbDataSet.Text, _fieldName);

            if (fieldNode != null)
            {
                var config = new PFModelConfig(fieldNode, lbDataSet.Text);
                tbName.Text = config.FieldName;
                tbText.Text = config.FieldText;
                if (config.FieldType != null)
                {
                    cbType.SelectedItem = PFDataHelper.GetStringByType(config.FieldType);
                }
                cbVisible.Checked = config.Visible;
                if (config.FieldSqlLength != null)
                {
                    nudSqlLength.Value    = config.FieldSqlLength.Value;
                    nudSqlLength.ReadOnly = !(cbHaveSqlLength.Checked = true);
                }
                else
                {
                    nudSqlLength.ReadOnly = !(cbHaveSqlLength.Checked = false);
                }
                if (config.FieldWidth != null)
                {
                    nudWidth.Value    = decimal.Parse(config.FieldWidth.Replace("px", ""));
                    nudWidth.ReadOnly = !(cbHaveWidth.Checked = true);
                }
                else
                {
                    nudWidth.ReadOnly = !(cbHaveWidth.Checked = false);
                }
                //_pfModelConfig = config;
            }
        }