public DateTimeEditor(string title, DateTime value, bool allowTemplates, string propertyName, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { _propertyName = propertyName; _onChange = onChange; _onActivate = onActivate; InitializeComponent(); labelTitle.Text = title; dateTimePicker.Value = value; }
public IntEditor(string title, int value, bool allowTemplates, string propertyName, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { _onChange = onChange; _onActivate = onActivate; _propertyName = propertyName; InitializeComponent(); labelTitle.Text = title; textValue.Text = value.ToString(); }
public CheckBoxEditor(string title, bool value, string propertyName, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { _propertyName = propertyName; _onChange = onChange; _onActivate = onActivate; InitializeComponent(); checkBox.Checked = value; checkBox.Text = title; }
public BrowseFolderEditor(string title, string value, string propertyName, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { _onChange = onChange; _onActivate = onActivate; _propertyName = propertyName; InitializeComponent(); labelTitle.Text = title; textValue.Text = value; }
public CheckBoxTemplateEditor(string title, object value, string propertyName, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { _propertyName = propertyName; _onChange = onChange; _onActivate = onActivate; InitializeComponent(); Value = value; checkBox.Text = title; AdjustControlState(); }
public override Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { var dateTime = (DateTime)value; if (dateTime <= DateTime.MinValue || dateTime >= DateTime.MaxValue) { dateTime = DateTime.Now; } Control control = new Editors.DateTimeEditor(Name, dateTime, AllowTemplates, propertyName, onChange, onActivate); return control; }
public ListEditor(string title, IEnumerable <ComboBoxItem> list, Type listType, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { _onChange = onChange; _onActivate = onActivate; _propertyName = propertyName; _listType = listType; _itemType = _listType.GetProperty("Item").PropertyType; _body = body; InitializeComponent(); labelTitle.Text = title; PopulateList(list); }
public ListEditor(string title, IEnumerable<ComboBoxItem> list, Type listType, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { _onChange = onChange; _onActivate = onActivate; _propertyName = propertyName; _listType = listType; _itemType = _listType.GetProperty("Item").PropertyType; _body = body; InitializeComponent(); labelTitle.Text = title; PopulateList(list); }
public TextEditor(string title, string value, int maxLength, string propertyName, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { _onChange = onChange; _onActivate = onActivate; _propertyName = propertyName; InitializeComponent(); labelTitle.Text = title; textValue.Text = value; if (maxLength > 0) { textValue.MaxLength = maxLength; } }
public SimpleComboBoxEditor(string title, object list, bool dropDownListOnly, string displayField, string valueField, string propertyName, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { _onChange = onChange; _onActivate = onActivate; _propertyName = propertyName; InitializeComponent(); labelTitle.Text = title; comboBox.DropDownStyle = dropDownListOnly ? ComboBoxStyle.DropDownList : ComboBoxStyle.DropDown; comboBox.ValueMember = valueField; comboBox.DisplayMember = displayField; comboBox.DataSource = list; comboBox.SelectedIndexChanged += new EventHandler(comboBox_SelectedIndexChanged); }
public override Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { Control control; if (Multiline) { control = new Editors.MultilineTextEditor(Name, (string)value, MaxLength, propertyName, onChange, onActivate); } else { control = new Editors.TextEditor(Name, (string)value, MaxLength, propertyName, onChange, onActivate); } return control; }
public MultilineTextEditor(string title, string value, int maxLength, string propertyName, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { _propertyName = propertyName; _onChange = onChange; _onActivate = onActivate; InitializeComponent(); labelTitle.Text = title; textValue.Text = value; if (maxLength > 0) { textValue.MaxLength = maxLength; } }
public override Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { var fields = ListEnum.GetFields().Where(f => f.FieldType == ListEnum).ToList(); var list = new List<Editors.ComboBoxItem>(); foreach (var f in fields) { var nameAttr = f.GetCustomAttributes(true).OfType<GinNameAttribute>().FirstOrDefault(); list.Add(new Editors.ComboBoxItem { Display = nameAttr != null ? nameAttr.Name : f.Name, Value = f.GetValue(null) }); } Control control = new Editors.ComboBoxEditor(Name, value, true, list, propertyName, onChange, onActivate); return control; }
public override Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { Control control; if (AllowTemplates) { control = new Editors.CheckBoxTemplateEditor(Name, value, propertyName, onChange, onActivate); } else { var boolValue = false; if (value is bool) { boolValue = (bool)value; } control = new Editors.CheckBoxEditor(Name, boolValue, propertyName, onChange, onActivate); } return control; }
public ComplexValueEditor(string title, object value, Type valueType, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { if (value == null) { value = GetDefaultValueOrNull(valueType); } _onChange = onChange; _onActivate = onActivate; _propertyName = propertyName; _valueType = valueType; _value = value; _body = body; InitializeComponent(); labelTitle.Text = title; if (value != null) { labelValue.Text = value.ToString(); } }
public override Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { Control control = null; var iList = value as IList; if (iList != null) { var list = new List<ComboBoxItem>(); foreach (var item in iList) { list.Add(new ComboBoxItem { Display = item.ToString(), Value = item }); } control = new ListEditor(Name, list, ListType, propertyName, body, onChange, onActivate); } return control; }
public ComboBoxEditor(string title, object value, bool dropDownListOnly, IEnumerable <ComboBoxItem> list, string propertyName, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { _onChange = onChange; _onActivate = onActivate; _propertyName = propertyName; InitializeComponent(); labelTitle.Text = title; comboBox.DropDownStyle = dropDownListOnly ? ComboBoxStyle.DropDownList : ComboBoxStyle.DropDown; comboBox.ValueMember = "Value"; comboBox.DisplayMember = "Display"; comboBox.DataSource = list; foreach (var item in comboBox.Items) { if (((ComboBoxItem)item).Value.ToString() == value.ToString()) { comboBox.SelectedItem = item; break; } } comboBox.SelectedIndexChanged += new EventHandler(comboBox_SelectedIndexChanged); }
public ComboBoxEditor(string title, object value, bool dropDownListOnly, IEnumerable<ComboBoxItem> list, string propertyName, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { _onChange = onChange; _onActivate = onActivate; _propertyName = propertyName; InitializeComponent(); labelTitle.Text = title; comboBox.DropDownStyle = dropDownListOnly ? ComboBoxStyle.DropDownList : ComboBoxStyle.DropDown; comboBox.ValueMember = "Value"; comboBox.DisplayMember = "Display"; comboBox.DataSource = list; foreach (var item in comboBox.Items) { if (((ComboBoxItem)item).Value.ToString() == value.ToString()) { comboBox.SelectedItem = item; break; } } comboBox.SelectedIndexChanged += new EventHandler(comboBox_SelectedIndexChanged); }
/// <summary> /// Returns null, 'cause it has no standard editor /// </summary> /// <returns>null</returns> public override Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { return(null); }
public override Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { Control control = new Editors.IntEditor(Name, (int)value, AllowTemplates, propertyName, onChange, onActivate); return control; }
/// <summary> /// Returns null, 'cause it has no standard editor /// </summary> /// <returns>null</returns> public override Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { return null; }
public override Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { Control control = new Editors.IntEditor(Name, (int)value, AllowTemplates, propertyName, onChange, onActivate); return(control); }
/// <summary> /// Returns the UI-editor for this property /// </summary> /// <param name="value">Initial value for editor</param> /// <param name="propertyName">Property name</param> /// <param name="body">The PackageBody of current package</param> /// <param name="onChange">PropertyChanged delegate</param> /// <param name="onActivate">PropertyActivated delegate</param> /// <returns>Windows Forms Control, which supplies the edit value function for this class property</returns> public abstract Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate);
public override Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { Control control = null; var iList = value as IList; if (iList != null) { var list = new List <ComboBoxItem>(); foreach (var item in iList) { list.Add(new ComboBoxItem { Display = item.ToString(), Value = item }); } control = new ListEditor(Name, list, ListType, propertyName, body, onChange, onActivate); } return(control); }
public override Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { Control control; if (AllowTemplates) { control = new Editors.CheckBoxTemplateEditor(Name, value, propertyName, onChange, onActivate); } else { var boolValue = false; if (value is bool) { boolValue = (bool)value; } control = new Editors.CheckBoxEditor(Name, boolValue, propertyName, onChange, onActivate); } return(control); }
public override Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { return new Editors.BrowseFolderEditor(Name, (string)value, propertyName, onChange, onActivate); }
public override Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { Control control; if (Multiline) { control = new Editors.MultilineTextEditor(Name, (string)value, MaxLength, propertyName, onChange, onActivate); } else { control = new Editors.TextEditor(Name, (string)value, MaxLength, propertyName, onChange, onActivate); } return(control); }
public override Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { Control control = new Editors.ComplexValueEditor(Name, value, ValueType, propertyName, body, onChange, onActivate); return(control); }
public override Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { Control control = new Editors.ComplexValueEditor(Name, value, ValueType, propertyName, body, onChange, onActivate); return control; }
public override Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { var dateTime = (DateTime)value; if (dateTime <= DateTime.MinValue || dateTime >= DateTime.MaxValue) { dateTime = DateTime.Now; } Control control = new Editors.DateTimeEditor(Name, dateTime, AllowTemplates, propertyName, onChange, onActivate); return(control); }
public override Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { return(new Editors.BrowseFileEditor(IsNewFile, Name, (string)value, propertyName, onChange, onActivate)); }
public override Control GetEditor(object value, string propertyName, PackageBody body, PropertyChangedDelegate onChange, PropertyActivatedDelegate onActivate) { var fields = ListEnum.GetFields().Where(f => f.FieldType == ListEnum).ToList(); var list = new List <Editors.ComboBoxItem>(); foreach (var f in fields) { var nameAttr = f.GetCustomAttributes(true).OfType <GinNameAttribute>().FirstOrDefault(); list.Add(new Editors.ComboBoxItem { Display = nameAttr != null ? nameAttr.Name : f.Name, Value = f.GetValue(null) }); } Control control = new Editors.ComboBoxEditor(Name, value, true, list, propertyName, onChange, onActivate); return(control); }