using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; namespace Mesnac.Controls.ChemicalWeighing.HslCurve { /// /// 参考坐标系的轴信息 /// // Token: 0x02000025 RID: 37 [TypeConverter(typeof(ReferenceAxisConverter))] public class ReferenceAxis { /// /// 实例化一个默认的对象 /// // Token: 0x060003A7 RID: 935 RVA: 0x00029144 File Offset: 0x00027344 public ReferenceAxis() { this.Max = 100f; this.Min = 0f; this.Color = Color.LightGray; this.Format = "{0}"; } /// /// 实例化一个默认的对象 /// // Token: 0x060003A8 RID: 936 RVA: 0x0002917E File Offset: 0x0002737E public ReferenceAxis(UserControl userControl) : this() { this._control = userControl; } // Token: 0x060003A9 RID: 937 RVA: 0x0002918F File Offset: 0x0002738F public ReferenceAxis(float max, float min, bool useLog) { this.Max = max; this.Min = min; this.useLogarithms = useLog; } /// /// 最大值 /// // Token: 0x1700011B RID: 283 // (get) Token: 0x060003AA RID: 938 RVA: 0x000291B0 File Offset: 0x000273B0 // (set) Token: 0x060003AB RID: 939 RVA: 0x000291B8 File Offset: 0x000273B8 [Category("HslControls")] [Description("获取或设置当前的Y轴的最大值")] [Browsable(true)] [DefaultValue(100f)] public float Max { get { return this._max; } set { this._max = value; UserControl control = this._control; if (control != null) { control.Invalidate(); } } } /// /// 最小值 /// // Token: 0x1700011C RID: 284 // (get) Token: 0x060003AC RID: 940 RVA: 0x000291D4 File Offset: 0x000273D4 // (set) Token: 0x060003AD RID: 941 RVA: 0x000291DC File Offset: 0x000273DC [Category("HslControls")] [Description("获取或设置当前的Y轴的最小值")] [Browsable(true)] [DefaultValue(0f)] public float Min { get { return this._min; } set { this._min = value; UserControl control = this._control; if (control != null) { control.Invalidate(); } } } /// /// 单位信息 /// // Token: 0x1700011D RID: 285 // (get) Token: 0x060003AE RID: 942 RVA: 0x000291F8 File Offset: 0x000273F8 // (set) Token: 0x060003AF RID: 943 RVA: 0x00029200 File Offset: 0x00027400 [Category("HslControls")] [Description("获取或设置当前的Y轴的单位值")] [Browsable(true)] [DefaultValue("")] public string Unit { get { return this._unit; } set { this._unit = value; UserControl control = this._control; if (control != null) { control.Invalidate(); } } } // Token: 0x1700011E RID: 286 // (get) Token: 0x060003B0 RID: 944 RVA: 0x0002921C File Offset: 0x0002741C // (set) Token: 0x060003B1 RID: 945 RVA: 0x00029224 File Offset: 0x00027424 [Category("HslControls")] [Description("是否使用对数的表示方式,在开始对数的模式下,无法表示小于等于0的数值,对数以10为底数")] [Browsable(true)] [DefaultValue(false)] public bool UseLogarithms { get { return this.useLogarithms; } set { this.useLogarithms = value; UserControl control = this._control; if (control != null) { control.Invalidate(); } } } /// /// 获取或设置当前的坐标系的颜色信息 /// // Token: 0x1700011F RID: 287 // (get) Token: 0x060003B2 RID: 946 RVA: 0x00029240 File Offset: 0x00027440 // (set) Token: 0x060003B3 RID: 947 RVA: 0x00029248 File Offset: 0x00027448 [Category("HslControls")] [Description("获取或设置当前的坐标系的颜色信息")] [Browsable(true)] [DefaultValue(typeof(Color), "LightGray")] public Color Color { get { return this._color; } set { this._color = value; Brush brush = this.Brush; if (brush != null) { brush.Dispose(); } this.Brush = new SolidBrush(this._color); Pen pen = this._pen; if (pen != null) { pen.Dispose(); } this._pen = new Pen(this._color, 1f); UserControl control = this._control; if (control != null) { control.Invalidate(); } } } /// /// 获取或设置当前坐标轴数字的格式化信息,默认为 {0}, 直接转字符串 /// // Token: 0x17000120 RID: 288 // (get) Token: 0x060003B4 RID: 948 RVA: 0x000292BB File Offset: 0x000274BB // (set) Token: 0x060003B5 RID: 949 RVA: 0x000292C3 File Offset: 0x000274C3 [Category("HslControls")] [Description("获取或设置当前坐标轴数字的格式化信息,默认为 {0}, 直接转字符串")] [Browsable(true)] [DefaultValue("{0}")] public string Format { get { return this._format; } set { this._format = value; UserControl control = this._control; if (control != null) { control.Invalidate(); } } } /// /// 获取画笔信息 /// /// 画笔信息 // Token: 0x060003B6 RID: 950 RVA: 0x000292E0 File Offset: 0x000274E0 public Pen GetPen() { bool flag = this._pen != null; Pen pen; if (flag) { pen = this._pen; } else { this._pen = new Pen(this.Color, 1f); pen = this._pen; } return pen; } // Token: 0x060003B7 RID: 951 RVA: 0x00029324 File Offset: 0x00027524 public bool IsUseLogarithms() { return this.useLogarithms && this._max > 0f && this._min > 0f; } // Token: 0x060003B8 RID: 952 RVA: 0x0002935C File Offset: 0x0002755C public float GetCalculateMax() { bool flag = this.IsUseLogarithms(); float result; if (flag) { result = (float)Math.Log10((double)this.Max); } else { result = this.Max; } return result; } // Token: 0x060003B9 RID: 953 RVA: 0x00029390 File Offset: 0x00027590 public float GetCalculateMin() { bool flag = this.IsUseLogarithms(); float result; if (flag) { result = (float)Math.Log10((double)this.Min); } else { result = this.Min; } return result; } // Token: 0x060003BA RID: 954 RVA: 0x000293C3 File Offset: 0x000275C3 public void SetMaxValue(float value) { this._max = value; } // Token: 0x060003BB RID: 955 RVA: 0x000293CD File Offset: 0x000275CD public void SetMinValue(float value) { this._min = value; } /// /// 画刷资源 /// // Token: 0x17000121 RID: 289 // (get) Token: 0x060003BC RID: 956 RVA: 0x000293D7 File Offset: 0x000275D7 // (set) Token: 0x060003BD RID: 957 RVA: 0x000293DF File Offset: 0x000275DF [Browsable(false)] public Brush Brush { get; set; } // Token: 0x040001C7 RID: 455 private float _max; // Token: 0x040001C8 RID: 456 private float _min; // Token: 0x040001C9 RID: 457 private string _unit; // Token: 0x040001CA RID: 458 private string _format; // Token: 0x040001CB RID: 459 private Color _color; // Token: 0x040001CC RID: 460 private UserControl _control; // Token: 0x040001CD RID: 461 private Pen _pen; // Token: 0x040001CE RID: 462 private bool useLogarithms; } }