2 /* Circ.Frontend.GtkSharp : GTK# frontend for Circ
3 * Copyright (C) 2007 LAVAL Jérémie
5 * This file is licensed under the terms of the LGPL.
7 * For the complete licence see the file COPYING.
11 using System
.Collections
.Generic
;
15 namespace Circ
.Frontend
.GtkSharp
17 public static class EmoticonsFactory
19 delegate Pixbuf
Worker();
20 // Thinking about memoization
21 public static Pixbuf
GetEmoticonFromSmiley(string smiley
)
23 Dictionary
<string, Pixbuf
> smileys
= new Dictionary
<string, Pixbuf
>();
25 Worker worker
= delegate {
27 if (smileys
.TryGetValue(smiley
, out temp
))
32 temp
= Pixbuf
.LoadFromResource("smile.png");
33 smileys
.Add(":)", temp
);
36 temp
= Pixbuf
.LoadFromResource("wink.png");
37 smileys
.Add(":D", temp
);