using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Mesnac.Controls.Default
{
[ToolboxBitmap(typeof(System.Windows.Forms.Label))]
public partial class CombinedLabel : UserControl
{
public CombinedLabel()
{
InitializeComponent();
this.ForeColor = this.Label1.ForeColor;
}
public override System.Drawing.Color ForeColor
{
get
{
return base.ForeColor;
}
set
{
base.ForeColor = value;
this.Label1.ForeColor = value;
this.Label2.ForeColor = value;
this.Label3.ForeColor = value;
this.Label4.ForeColor = value;
this.Label5.ForeColor = value;
this.ReplaceLabel1.ForeColor = value;
}
}
protected bool _bHaveAction;
///
/// 是否有动画
///
public bool bHaveAction
{
get
{
return _bHaveAction;
}
set
{
_bHaveAction = value;
}
}
///
/// 状态表达式
///
[Description("状态表达式"), Category("Data")]
public string StatusReplaceExpress
{
get { return this.ReplaceLabel1.ReplaceExpress; }
set { this.ReplaceLabel1.ReplaceExpress = value; }
}
///
/// 完成数格式
///
[Description("完成数格式"), Category("Data")]
public string CompleteNumFormat
{
get { return this.Label4.Format; }
set { this.Label4.Format = value; }
}
///
/// 重量格式
///
[Description("重量格式"), Category("Data")]
public string WeightFormat
{
get { return this.Label5.Format; }
set { this.Label5.Format = value; }
}
///
/// 状态动画属性
///
public string StatusName
{
get { return this.ReplaceLabel1.TextName; }
set { this.ReplaceLabel1.TextName = value; }
}
///
/// 完成数动画属性
///
public string CompleteNumName
{
get { return this.Label4.TextName; }
set { this.Label4.TextName = value; }
}
///
/// 重量动画属性
///
public string WeightName
{
get { return this.Label5.TextName; }
set { this.Label5.TextName = value; }
}
///
/// 状态
///
public string Status
{
get { return this.ReplaceLabel1.TextValue; }
set { this.ReplaceLabel1.TextValue = value; }
}
///
/// 完成数
///
public string CompleteNum
{
get { return this.Label4.TextValue; }
set
{
this.Label4.TextValue = value;
if (String.IsNullOrEmpty(value) || value == "0")
{
this.Visible = false;
}
else
{
this.Visible = true;
}
}
}
///
/// 重量
///
public string Weight
{
get { return this.Label5.TextValue; }
set { this.Label5.TextValue = value; }
}
private void CombinedLabel_Resize(object sender, EventArgs e)
{
this.Size = new Size(90, 48);
}
}
}