Class FloatEditor
- Namespace
- OmegaEngine.Foundation.Design
- Assembly
- OmegaEngine.Foundation.dll
Abstract base class for drop-down PropertyGrid editors that can be associated with float or double properties.
public abstract class FloatEditor : UITypeEditor
- Inheritance
-
objectFloatEditor
- Derived
- Inherited Members
Methods
EditValue(ITypeDescriptorContext?, IServiceProvider?, object?)
Edits the specified object's value using the editor style indicated by the GetEditStyle() method.
public override object EditValue(ITypeDescriptorContext? context, IServiceProvider? provider, object? value)
Parameters
contextITypeDescriptorContextAn ITypeDescriptorContext that can be used to gain additional context information.
providerIServiceProviderAn IServiceProvider that this editor can use to obtain services.
valueobjectThe object to edit.
Returns
- object
The new value of the object. If the value of the object has not changed, this should return the same object it was passed.
EditValue(double, FloatRangeAttribute, IWindowsFormsEditorService)
Displays the UI to edit the float value.
protected abstract double EditValue(double value, FloatRangeAttribute range, IWindowsFormsEditorService editorService)
Parameters
valuedoubleThe current value.
rangeFloatRangeAttributeThe range of valid values the user can select.
editorServiceIWindowsFormsEditorServiceThe editor service used to display the dropdown control.
Returns
- double
The value set by the user.
EditValue(double, IWindowsFormsEditorService)
Displays the UI to edit the float value.
protected abstract double EditValue(double value, IWindowsFormsEditorService editorService)
Parameters
valuedoubleThe current value.
editorServiceIWindowsFormsEditorServiceThe editor service used to display the dropdown control.
Returns
- double
The value set by the user.
GetEditStyle(ITypeDescriptorContext?)
Gets the editor style used by the EditValue(IServiceProvider, object) method.
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext? context)
Parameters
contextITypeDescriptorContextAn ITypeDescriptorContext that can be used to gain additional context information.
Returns
- UITypeEditorEditStyle
A UITypeEditorEditStyle value that indicates the style of editor used by the EditValue(IServiceProvider, object) method. If the UITypeEditor does not support this method, then GetEditStyle() will return None.
TryGetDouble(object?, out double)
Interprets value as a double if it is a float or double.
protected bool TryGetDouble(object? value, out double doubleValue)
Parameters
valueobjectdoubleValuedouble