123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using PaintDotNet.Base;
- using PaintDotNet.CustomControl;
- using System;
- using System.Collections.Generic;
- using System.Windows.Forms;
- namespace PaintDotNet.Data.Param
- {
- /// <summary>
- /// 布尔类型,针对脚本目前设计有两种状态
- /// 1、Lists下有数据,则不铺UI,继续进行循环
- /// 2、Lists下没有数据,则铺一个是否的下拉
- /// </summary>
- public class BooleanObject : Args
- {
- public void Boolean_ValueChanged(object sender, EventArgs e)
- {
- if (sender.GetType() == typeof(Button))
- {
- if (((Button)sender).Text == "反选")
- {
- this.Value = false;
- }
- else//取消反选
- {
- this.Value = true;
- }
- //}
- //else if (sender.GetType() == typeof(NumericUpDown))
- //{
- // this.Value = (int)((NumericUpDown)sender).Value;
- }
- else if (sender.GetType() == typeof(ComboBox))
- {
- if (((ComboBox)sender).SelectedIndex == 1)
- this.Value = false;
- else
- this.Value = true;
- }
- }
- public void CheckBox_ValueChanged(object sender, EventArgs e)
- {
- if (sender.GetType() == typeof(CheckBox))
- {
- this.Value = ((CheckBox)sender).Checked;
- }
- }
- public BooleanObject(string key, string name, Args[] arr)
- {
- this.Type = Dtryt.Boolean;
- this.key = key;
- this.name = name;
- this.initialValue = false;
- this.value = false;
- if (arr!=null)
- {
- this.Lists = new List<Args>(arr);
- }
- }
- public BooleanObject(string key, string name, object value, Args[] arr)
- {
- this.Type = Dtryt.Boolean;
- this.key = key;
- this.name = name;
- this.initialValue = value;
- this.value = value;
- if (arr != null)
- {
- this.Lists = new List<Args>(arr);
- }
- }
- public BooleanObject()
- {
- this.Type = Dtryt.Boolean;
- }
- }
- }
|