PrintLabelTemplate.cs 1005 字节
using System;
using System.Collections.Generic;
using System.Drawing;

namespace Model
{
    public class PrintLabelTemplate
    {
        public List<PrintLabelField> Field = new();
        public string FilePath { set; get; } = "";
        public string Name { set; get; } = "";
        public SizeF Size { set; get; } = new();
        public TemplateState State { get; set; } = TemplateState.Saved;
        public bool FieldShowKey { set; get; } = false;


        public PrintLabelTemplate Clone()
        {
            PrintLabelTemplate node = new();
            for (int i = 0; i < Field.Count; i++)
                node.Field.Add(Field[i].Clone());

            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;
        }

    }
}