using System; namespace Gwen.Control.Property { /// /// Base control for property entry. /// public class Base : Control.Base { /// /// Initializes a new instance of the class. /// /// Parent control. public Base(Control.Base parent) : base(parent) { Height = 17; } /// /// Invoked when the property value has been changed. /// public event GwenEventHandler ValueChanged; /// /// Property value (todo: always string, which is ugly. do something about it). /// public virtual String Value { get { return null; } set { SetValue(value, false); } } /// /// Indicates whether the property value is being edited. /// public virtual bool IsEditing { get { return false; } } protected virtual void DoChanged() { if (ValueChanged != null) ValueChanged.Invoke(this); } protected virtual void OnValueChanged(Control.Base control) { DoChanged(); } /// /// Sets the property value. /// /// Value to set. /// Determines whether to fire "value changed" event. public virtual void SetValue(String value, bool fireEvents = false) { } } }