73 lines
1.7 KiB
C#
73 lines
1.7 KiB
C#
|
namespace RecipeEditorLib.RecipeModel.Params
|
|||
|
{
|
|||
|
public class DoubleParam : NumParamBase<double>
|
|||
|
{
|
|||
|
#region Variables
|
|||
|
|
|||
|
private int _resolution;
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Constructors
|
|||
|
|
|||
|
public DoubleParam()
|
|||
|
{
|
|||
|
Placeholder = "*";
|
|||
|
}
|
|||
|
|
|||
|
public DoubleParam(double initValue) : base(initValue)
|
|||
|
{
|
|||
|
Placeholder = "*";
|
|||
|
}
|
|||
|
|
|||
|
public DoubleParam(double initValue, string placeholder) : base(initValue)
|
|||
|
{
|
|||
|
Placeholder = placeholder;
|
|||
|
}
|
|||
|
|
|||
|
public DoubleParam(double initValue, double minimum, double maximum) : base(initValue, minimum, maximum)
|
|||
|
{
|
|||
|
Placeholder = "*";
|
|||
|
}
|
|||
|
|
|||
|
public DoubleParam(double initValue, double minimum, double maximum, string placeholder) : base(initValue, minimum, maximum)
|
|||
|
{
|
|||
|
Placeholder = placeholder;
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 返回当Value不可用时的占位符。
|
|||
|
/// </summary>
|
|||
|
public string Placeholder { get; }
|
|||
|
|
|||
|
|
|||
|
public override bool IsHideValue
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (Name == RecipColNo.Time.ToString())
|
|||
|
return false;
|
|||
|
|
|||
|
return _isHideValue;
|
|||
|
}
|
|||
|
set
|
|||
|
{
|
|||
|
_isHideValue = value;
|
|||
|
NotifyOfPropertyChange(nameof(IsHideValue));
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public int Resolution
|
|||
|
{
|
|||
|
get => _resolution;
|
|||
|
set
|
|||
|
{
|
|||
|
_resolution = value;
|
|||
|
NotifyOfPropertyChange(nameof(Resolution));
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|