예제 #1
0
        public override string ToString()
        {
            if (String.IsNullOrEmpty(Message))
            {
                return(String.Empty);
            }
            else if (CssClass != CssMessageClassEnum.none)
            {
                if (Dismiss == MessageDismissEnum.none)
                {
                    return(string.Format("<div class=\"{0}\">{1}</div>", CssClass.GetEnumDescription <CssMessageClassEnum>(), Message));
                }
                else if (Dismiss == MessageDismissEnum.close)
                {
                    return(string.Format("<div class=\"{0}\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>{1}</div>", CssClass.GetEnumDescription <CssMessageClassEnum>(), Message));
                }
                else
                {
                    return(string.Format("<div class=\"{0} alert-timeout\" data-timeout=\"{2}\">{1}</div>", CssClass.GetEnumDescription <CssMessageClassEnum>(), Message, Timeout.ToString()));
                }
            }

            return(base.ToString());
        }