예제 #1
0
        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;
            }
        }
예제 #2
0
        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;
            }
        }
예제 #3
0
 protected void SetStatus(EnumHelper.LabelStatus status, string str)
 {
     SetLabelStatus(status, txtStatus, str);
 }