コード例 #1
0
        public static string ProcessMessage(string message)
        {
            var messageProcessed = Emotions.ReplaceEmotions(message);

            messageProcessed = Link.ReplaceAllLink(messageProcessed);
            return(messageProcessed);
        }
コード例 #2
0
ファイル: Emotion.cs プロジェクト: newbiecse/demosignalrchat
        //public static string ReplaceEmotion(string specialKey, string image)
        //{
        //    return
        //}

        public static string ReplaceEmotions(string text)
        {
            return(text.Replace(":)", Emotions.InsertImage("happy.gif"))
                   .Replace(":(", Emotions.InsertImage("sad.gif"))
                   .Replace(";)", Emotions.InsertImage("winking.gif"))
                   .Replace(";D", Emotions.InsertImage("big_grin.gif"))

                   .Replace(":-c", Emotions.InsertImage("call_me.gif"))
                   .Replace(":-*", Emotions.InsertImage("kiss.gif"))
                   .Replace(":-SS", Emotions.InsertImage("applause.gif"))
                   .Replace(":v", Emotions.InsertImage("pacman.png"))
                   .Replace("^_^", Emotions.InsertImage("kiki.png"))
                   .Replace("B|", Emotions.InsertImage("sunglasses.png")));
        }
コード例 #3
0
        public static string ProcessNewComment(UserViewModel userComment, string message)
        {
            var messageProcessed = Emotions.ReplaceEmotions(message);

            messageProcessed = Link.ReplaceAllLink(messageProcessed);

            return
                ("<div class='comment'>"
                 + "<div class='comment-user'>"
                 + "<a href='#'>"
                 + "<img src='" + userComment.Avatar + "' class='img-rounded img33x33'>"
                 + "</a>"
                 + "</div>"
                 + "<div class='comment-content'>"
                 + "<p>"
                 + "<a href='#'>" + userComment.Displayname + "</a>"
                 + "&nbsp;&nbsp;"
                 + messageProcessed
                 + "</p>"
                 + "<p>" + DateTime.Now + " . <a href='#'>like</a></p>"
                 + "</div>"
                 + "<div class='clear-left'></div>"
                 + "</div>");
        }