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.
83 lines
2.0 KiB
C#
83 lines
2.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace POSV.Printer
|
|
{
|
|
[Serializable]
|
|
[JsonObject(MemberSerialization.OptIn)]
|
|
public class BitmapXParameter
|
|
{
|
|
/// <summary>
|
|
/// 模版变量
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "template")]
|
|
public Tuple<BitmapXTemplate> Template { get; set; }
|
|
|
|
[JsonProperty(PropertyName = "font")]
|
|
public FontStyle FontStyle { get; set; }
|
|
|
|
[JsonProperty(PropertyName = "align")]
|
|
public AlignStyle AlignStyle { get; set; }
|
|
}
|
|
|
|
[Serializable]
|
|
[JsonObject(MemberSerialization.OptIn)]
|
|
public class BitmapXTemplate
|
|
{
|
|
private Dictionary<string, List<VariableItem>> _dataSource;
|
|
|
|
public BitmapXTemplate(Dictionary<string, List<VariableItem>> dataSource)
|
|
{
|
|
this._dataSource = dataSource;
|
|
|
|
this.DataSourceKey = "默认数据源";
|
|
|
|
this.Var1 = new VariableItem();
|
|
this.Condition = new VariableItem();
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 数据源
|
|
/// </summary>
|
|
[JsonIgnore]
|
|
public Dictionary<string, List<VariableItem>> DataSource
|
|
{
|
|
get
|
|
{
|
|
return this._dataSource;
|
|
}
|
|
set
|
|
{
|
|
this._dataSource = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 绑定的数据源Key
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "data")]
|
|
public string DataSourceKey { get; set; }
|
|
|
|
/// <summary>
|
|
/// 行的打印条件变量
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "condition")]
|
|
public VariableItem Condition { get; set; }
|
|
|
|
/// <summary>
|
|
/// 条码内容变量
|
|
/// </summary>
|
|
[JsonProperty(PropertyName = "var1")]
|
|
public VariableItem Var1 { get; set; }
|
|
|
|
public override string ToString()
|
|
{
|
|
return JSON.Serialize(this);
|
|
}
|
|
}
|
|
}
|