public override void SetProperty(DesignerPropertyInfo property, object obj) { base.SetProperty(property, obj); DesignerBoolean boolAtt = property.Attribute as DesignerBoolean; if (boolAtt != null) { checkBox.Checked = (bool)property.Property.GetValue(obj, null); } DesignerFlexibleBoolean flexBooleanAtt = property.Attribute as DesignerFlexibleBoolean; if (flexBooleanAtt != null) { FlexiblePropertyBoolean flexProp = (FlexiblePropertyBoolean)property.Property.GetValue(obj, null); checkBox.Checked = flexProp.Value; } }
private void checkBox_CheckedChanged(object sender, EventArgs e) { if (!_valueWasAssigned) { return; } if (_property.Attribute is DesignerBoolean) { _property.Property.SetValue(_object, checkBox.Checked, null); } if (_property.Attribute is DesignerFlexibleBoolean) { FlexiblePropertyBoolean flexProp = (FlexiblePropertyBoolean)_property.Property.GetValue(_object, null); flexProp.Value = checkBox.Checked; } OnValueChanged(); }