protected void SetLabelStatus(EnumHelper.LabelStatus status, Label lblStatus, string str) { lblStatus.Text = str; switch (status) { case EnumHelper.LabelStatus.Faild: lblStatus.ForeColor = Color.Red; break; case EnumHelper.LabelStatus.Success: lblStatus.ForeColor = Color.Green; break; case EnumHelper.LabelStatus.Normal: default: lblStatus.ForeColor = Color.Black; break; } }
protected void SetLabelStatus(EnumHelper.LabelStatus status, RichTextBox txtStatus, string str) { int start = txtStatus.TextLength; txtStatus.AppendText((txtStatus.TextLength == 0?"": "\n") + str); txtStatus.Select(start, txtStatus.TextLength); switch (status) { case EnumHelper.LabelStatus.Faild: txtStatus.SelectionColor = Color.Red; break; case EnumHelper.LabelStatus.Success: txtStatus.SelectionColor = Color.Green; break; case EnumHelper.LabelStatus.Normal: default: txtStatus.SelectionColor = Color.Black; break; } }
protected void SetStatus(EnumHelper.LabelStatus status, string str) { SetLabelStatus(status, txtStatus, str); }