public Message(PublishArrivedArgs e) { Datetime = DateTime.Now; Topic = e.Topic; Payload = e.Payload.ToString(); Name = StaticResources.QosToName(e.QualityOfService); Retained = e.Retained ? "是" : "否"; }
public override string ToString() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("任务名:" + TaskName + "\r\n"); stringBuilder.Append("运行状态:" + (state ? "运行中" : "停止") + "\r\n"); stringBuilder.Append("推送主题:" + topic + "\r\n"); stringBuilder.Append("服务质量:" + StaticResources.QosToName(qoS)); stringBuilder.Append("是否保留:" + (retained ? "是" : "否") + "\r\n"); return(stringBuilder.ToString()); }