PrintLabelField.cs
921 字节
using System;
using System.Drawing;
namespace Model
{
public class PrintLabelField
{
public PrintLabelFieldType Type { set; get; } = PrintLabelFieldType.Text;
public string Text { set; get; } = "";
public RectangleF Rectangle { set; get; } = new();
public Font Font { set; get; } = new("宋体", 9f);
public string PrintText = "";
public Bitmap Image = null;
public PrintLabelField Clone()
{
PrintLabelField node = new();
if (Image != null) node.Image = new Bitmap(Image);
System.Reflection.PropertyInfo[] destination = node.GetType().GetProperties();
System.Reflection.PropertyInfo[] orgin = GetType().GetProperties();
for (int i = 0; i < destination.Length; i++)
destination[i].SetValue(node, orgin[i].GetValue(this));
return node;
}
}
}