You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

239 lines
5.3 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using Mesnac.Controls.Base;
namespace Mesnac.Controls.Default
{
[ToolboxBitmap(typeof(System.Windows.Forms.PictureBox))]
public partial class MCPictureBox : PictureBox, IPurviewControl
{
private List<DesignAction> _clickActionList = new List<DesignAction>();
private bool _mcVisible = true; //保存可见性
private bool _mcEnabled = true; //保存可用性
private bool _isValid = true; //保存有效性
public MCPictureBox()
{
InitializeComponent();
}
public MCPictureBox(IContainer container)
{
container.Add(this);
InitializeComponent();
}
#region 事件
public List<DesignAction> ClickActionList
{
get
{
return this._clickActionList;
}
set
{
this._clickActionList = value;
}
}
private List<DesignAction> _mouseDown = new List<DesignAction>();
public List<DesignAction> MouseDown
{
get
{
return this._mouseDown;
}
set
{
this._mouseDown = value;
}
}
private List<DesignAction> _mouseup = new List<DesignAction>();
public List<DesignAction> MouseUp
{
get
{
return this._mouseup;
}
set
{
this._mouseup = value;
}
}
private List<DesignAction> _mousemove = new List<DesignAction>();
public List<DesignAction> MouseMove
{
get
{
return this._mousemove;
}
set
{
this._mousemove = value;
}
}
#endregion
public string MCKey
{
get;
set;
}
public object MCValue
{
get
{
return this.Text;
}
set
{
this.Text = value == null ? "" : value.ToString();
}
}
public IBaseControl MCRoot
{
get
{
return null;
}
set
{
;
}
}
[TypeConverter(typeof(DataSourceConverter))]
[Description("数据连接"), Category("数据")]
public string MCDataSourceID
{
get;
set;
}
public MCDataSource MCDataSource
{
get;
set;
}
[Description("是否为数据库控件"), Category("数据")]
public bool IsDbControl
{
get;
set;
}
[Description("初始化SQL"), Category("数据")]
public string InitDataSource
{
get;
set;
}
[Description("执行SQL"), Category("数据")]
public string ActionDataSource
{
get;
set;
}
[Description("绑定数据源"), Category("数据")]
public object BindDataSource
{
get;
set;
}
[Description("操作类型"), Category("数据")]
public DbOptionTypes DbOptionType
{
get;
set;
}
[Description("是否可见"), Category("行为")]
public bool MCVisible
{
get
{
return this._mcVisible;
}
set
{
this._mcVisible = value == null ? true : value;
if (this.Site.DesignMode)
{
this.Visible = true;
}
else
{
this.Visible = this._mcVisible;
}
}
}
[Description("是否可用"), Category("行为")]
public bool MCEnabled
{
get
{
return this._mcEnabled;
}
set
{
this._mcEnabled = value == null ? true : value;
if (this.Site.DesignMode)
{
this.Enabled = true;
}
else
{
this.Enabled = this._mcEnabled;
}
}
}
[Description("是否控制权限"), Category("行为")]
public bool MCPurview
{
get;
set;
}
[Description("图片类型"), Category("图片跳转")]
public string PictureType
{
get;
set;
}
[Description("图片页码"), Category("图片跳转")]
public int PictureNum
{
get;
set;
}
/// <summary>
/// 机种类型
/// </summary>
public string MachineType
{
get;
set;
}
public bool IsValid
{
get { return _isValid; }
set { _isValid = value; }
}
}
}