using DevExpress.XtraEditors;
|
using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Drawing;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using System.Windows.Forms;
|
|
namespace IStation.WinFrmUI.Monitor
|
{
|
public partial class SetRangeDlg : DevExpress.XtraEditors.XtraForm
|
{
|
public SetRangeDlg()
|
{
|
InitializeComponent();
|
this.IconOptions.Icon = IStation.WinFrmUI.Properties.Resources.App;
|
}
|
|
public double MinValue { get; private set; }
|
public double MaxValue { get; private set; }
|
|
private bool Valid()
|
{
|
this.dxErrorProvider1.ClearErrors();
|
if (string.IsNullOrEmpty(this.txtMinValue.Text.Trim()))
|
{
|
this.dxErrorProvider1.SetError(this.txtMinValue, "必填项");
|
return false;
|
}
|
if (string.IsNullOrEmpty(this.txtMaxValue.Text.Trim()))
|
{
|
this.dxErrorProvider1.SetError(this.txtMaxValue, "必填项");
|
return false;
|
}
|
return true;
|
}
|
|
private void btnOk_Click(object sender, EventArgs e)
|
{
|
if (!Valid())
|
return;
|
this.MinValue = double.Parse(this.txtMinValue.Text);
|
this.MaxValue = double.Parse(this.txtMaxValue.Text);
|
if (this.MinValue > this.MaxValue)
|
{
|
XtraMessageBox.Show("区间设置不合理!");
|
return;
|
}
|
this.DialogResult = DialogResult.OK;
|
this.Close();
|
}
|
}
|
}
|