Ejemplo n.º 1
0
 public EmoticonFindResult(Emoticon e, int offset, int len)
 {
     Emoticon = e;
     Offset = offset;
     Length = len;
 }
Ejemplo n.º 2
0
        private static Image GetImage(Emoticon emote)
        {
            if (emote == null)
                return null;

            BitmapImage src;
            if (!s_emotes.TryGetValue(emote, out src))
            {
                if (string.IsNullOrWhiteSpace(emote.LocalFile) || !File.Exists(emote.LocalFile))
                    return null;

                try
                {
                    src = new BitmapImage();
                    src.BeginInit();
                    src.UriSource = new Uri(emote.LocalFile, UriKind.RelativeOrAbsolute);
                    src.EndInit();
                }
                catch
                {
                    try
                    {
                        var local = emote.LocalFile;
                        emote.LocalFile = local;
                        File.Delete(local);
                        emote.ForceRedownload();
                    }
                    catch
                    {
                    }

                    return null;
                }
            }

            Image img = new Image();
            img.Source = src;
            if (emote.Height != -1)
                img.Height = (int)emote.Height;

            if (emote.Width != -1)
                img.Width = (int)emote.Width;

            img.Stretch = Stretch.Uniform;
            return img;
        }
Ejemplo n.º 3
0
 internal void Add(Emoticon e)
 {
     m_emoticons.Add(e);
 }