Sic04/FrameworkLocal/UIClient/RecipeEditorLib/RecipeModel/Params/DoubleParam.cs

73 lines
1.7 KiB
C#
Raw Normal View History

namespace RecipeEditorLib.RecipeModel.Params
2022-09-19 09:16:33 +08:00
{
public class DoubleParam : NumParamBase<double>
2022-09-19 09:16:33 +08:00
{
#region Variables
private int _resolution;
#endregion
#region Constructors
public DoubleParam()
2022-09-19 09:16:33 +08:00
{
Placeholder = "*";
2022-09-19 09:16:33 +08:00
}
public DoubleParam(double initValue) : base(initValue)
2022-09-19 09:16:33 +08:00
{
Placeholder = "*";
2022-09-19 09:16:33 +08:00
}
public DoubleParam(double initValue, string placeholder) : base(initValue)
2022-09-19 09:16:33 +08:00
{
Placeholder = placeholder;
2022-09-19 09:16:33 +08:00
}
public DoubleParam(double initValue, double minimum, double maximum) : base(initValue, minimum, maximum)
2022-09-19 09:16:33 +08:00
{
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;
}
2022-09-19 09:16:33 +08:00
set
{
_isHideValue = value;
NotifyOfPropertyChange(nameof(IsHideValue));
2022-09-19 09:16:33 +08:00
}
}
public int Resolution
2022-09-19 09:16:33 +08:00
{
get => _resolution;
2022-09-19 09:16:33 +08:00
set
{
_resolution = value;
NotifyOfPropertyChange(nameof(Resolution));
2022-09-19 09:16:33 +08:00
}
}
}
}