[Extension("تحول الابتسامات المكتوبة في التعليقات إلى صور ", "1.3", "مطوريّ المدونة")]
public class Smilies
{
static Smilies()
{
Comment.Serving += new EventHandler<ServingEventArgs>(Post_CommentServing);
}
/// <summary>
/// The event handler that is triggered every time a comment is served to a client.
/// </summary>
private static void Post_CommentServing(object sender, ServingEventArgs e)
{
if (!string.IsNullOrEmpty(e.Body))
{
e.Body = e.Body.Replace("(H)", Convert("cool", "هادئ"));
e.Body = e.Body.Replace(":'(", Convert("cry", "باكي"));
e.Body = e.Body.Replace(":$", Convert("embarassed", "خجل"));
e.Body = e.Body.Replace(":|", Convert("foot-in-mouth", "منزعج"));
e.Body = e.Body.Replace(":(", Convert("frown", "حزين"));
e.Body = e.Body.Replace("(A)", Convert("innocent", "بريء"));
e.Body = e.Body.Replace("(K)", Convert("kiss", "محب"));
e.Body = e.Body.Replace(":D", Convert("laughing", "ضاحك"));
e.Body = e.Body.Replace("($)", Convert("money-mouth", "نقود"));
e.Body = e.Body.Replace(":-#", Convert("sealed", "محكم"));
e.Body = e.Body.Replace(":)", Convert("smile", "مبتسم"));
e.Body = e.Body.Replace(":-)", Convert("smile", "مبتسم"));
e.Body = e.Body.Replace(":-O", Convert("surprised", "متفاجئ"));
e.Body = e.Body.Replace(":P", Convert("tongue-out", "مازح"));
e.Body = e.Body.Replace("*-)", Convert("undecided", "متردد"));
e.Body = e.Body.Replace(";-)", Convert("wink", "غمزة"));
e.Body = e.Body.Replace("8o|", Convert("yell", "صارخ"));
}
}
}