using PaintDotNet.Base;
using PaintDotNet.CustomControl;
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace PaintDotNet.Data.Param
{
///
/// 布尔类型,针对脚本目前设计有两种状态
/// 1、Lists下有数据,则不铺UI,继续进行循环
/// 2、Lists下没有数据,则铺一个是否的下拉
///
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(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(arr);
}
}
public BooleanObject()
{
this.Type = Dtryt.Boolean;
}
}
}