// C o n s t r u c t o r public UserRequestPropertyFilesEditor(UserRequestProperty prop) { InitializeComponent(); this.prop = prop; MapFiles(); RefreshList(); }
private void AddControlToGroup(UserRequestProperty prop, LayoutGroup group, Control control, eLayoutSizeType withType = eLayoutSizeType.Percent, int width = 100) { control.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0); var item = new LayoutControlItem() { TextVisible = true, WidthType = withType, Width = width, HeightType = eLayoutSizeType.Absolute, Height = control.Height + 8, Control = control }; if (control is TextBoxX) { item.MinSize = new Size(120, 0); } LayoutControl1.Controls.Add(control); group.Items.Add(item); if (control is TextBoxX) { // item.MinSize = New Size(120, 0) if (!prop.AllowEmptyState) { var validor = new DevComponents.DotNetBar.Validator.RequiredFieldValidator("Requied field!") { HighlightColor = DevComponents.DotNetBar.Validator.eHighlightColor.Red }; SuperValidator1.SetValidator1(control, validor); } } }
private void AddValueFiles(LayoutGroup group, UserRequestProperty prop) { var control = new UserRequestPropertyFilesEditor(prop) { Tag = prop, BackColor = Color.Transparent, Size = new Size(120, 120) }; control.TextChanged += (sender, e) => { var csender = sender as Control; ((UserRequestProperty)csender.Tag).Value = csender.Text.Trim(); }; AddControlToGroup(prop, group, control); }
private void AddValueText(LayoutGroup group, UserRequestProperty prop, bool multiline) { var control = new TextBoxX() { Text = prop.Value, Tag = prop, Multiline = multiline, Size = new Size(75, multiline ? 75 : 20) }; control.Border.Class = "TextBoxBorder"; control.TextChanged += (sender, e) => { var csender = sender as Control; ((UserRequestProperty)csender.Tag).Value = csender.Text.Trim(); }; AddHandlerGotFocus(control); AddControlToGroup(prop, group, control); }