using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ComponentModel; namespace SocketTransfer.SDK { public class SocketSend : SocketBase { public SocketSend(byte[] source, params int[] phases) : base(source, (new int[] { 6, 10, 6, 6, 4, 9 }).Concat(phases).ToArray()) { } public SocketSend(params int[] phases) : this(new byte[phases.Sum() + 41], phases) { } public byte[] ResetSize() { RebuildSource(); SetValue(0, Length(Source).ToString()); return Source; } [CategoryAttribute("数据段"), DescriptionAttribute("包长")] /// /// 包长 /// public int Size { get { return int.Parse(GetValue(0)); } set { SetValue(0, value.ToString()); } } [CategoryAttribute("数据段"), DescriptionAttribute("服务区码")] /// /// 服务区码 /// public string SERVERPARTCODE { get { return GetValue(1); } set { SetValue(1, value); } } [CategoryAttribute("数据段"), DescriptionAttribute("门店编码")] /// /// 门店编码 /// public string SHOPCODE { get { return GetValue(2); } set { SetValue(2, value); } } [CategoryAttribute("数据段"), DescriptionAttribute("机器号码")] /// /// 机器号码 /// public string MACHINECODE { get { return GetValue(3); } set { SetValue(3, value); } } [CategoryAttribute("数据段"), DescriptionAttribute("传输类型")] /// /// 传输类型 /// public int ReceiveType { get { return string.IsNullOrEmpty(GetValue(4)) ? default(int) : int.Parse(GetValue(4)); } set { SetValue(4, value.ToString()); } } [CategoryAttribute("数据段"), DescriptionAttribute("传输内码")] /// /// 传输类型 /// public int TRANSFER_ID { get { return string.IsNullOrEmpty(GetValue(5)) ? default(int) : int.Parse(GetValue(5)); } set { SetValue(5, value.ToString()); } } } }