public NoticeRecvForm(ConnectionContext connectionContext, QpNoticeInfo noticeInfo = null) { this.connectionContext = connectionContext; InitializeComponent(); if (noticeInfo == null) { txtFormTitle.Text = $"{Text} - {connectionContext.ConnectionInfo.Name}"; txtNoticeTypeName.Text = "*"; } else { txtFormTitle.Text = $"{Text} - {noticeInfo.Name} - {connectionContext.ConnectionInfo.Name}"; txtNoticeTypeName.Text = noticeInfo.NoticeTypeName; } }
public NoticeInfoControl(QpNoticeInfo item) { InitializeComponent(); StringBuilder sb = new StringBuilder(); sb.AppendLine($"名称:{item.Name}"); sb.AppendLine($"类名称:{item.NoticeTypeName}"); if (!string.IsNullOrEmpty(item.Description)) { sb.AppendLine("描述:"); sb.AppendLine("---------------------"); sb.AppendLine(item.Description); } txtBasic.Text = sb.ToString(); txtSchema.Text = item.NoticeTypeSchema; txtSchemaSample.Text = item.NoticeTypeSchemaSample; }