Ejemplo n.º 1
0
        private void App_GifEmoteFramesUpdated(object s, EventArgs e)
        {
            try
            {
                lock (bufferLock)
                {
                    if (buffer != null)
                    {
                        var hasUpdated = false;

                        if (MessageLock != null)
                        {
                            lock (MessageLock)
                            {
                                //for (int i = 0; i < Messages.Length; i++)
                                //{
                                //    var msg = Messages[i];
                                //    if (msg.IsVisible)
                                //    {
                                //        hasUpdated = true;

                                //        MessageRenderer.DrawGifEmotes(buffer.Graphics, msg, selection, i);
                                //    }
                                //}

                                hasUpdated = true;

                                MessageRenderer.DrawGifEmotes(buffer.Graphics, GifEmotesOnScreen, selection);
                            }
                        }

                        if (hasUpdated)
                        {
                            var borderPen = Selected ? App.ColorScheme.ChatBorderFocused : App.ColorScheme.ChatBorder;
                            buffer.Graphics.DrawRectangle(borderPen, 0, Height - 1, Width - 1, 1);

                            var g = CreateGraphics();

                            buffer.Render(g);

                            g.Dispose();
                        }
                    }
                }
            }
            catch { }
        }
Ejemplo n.º 2
0
        private void App_GifEmoteFramesUpdated(object s, EventArgs e)
        {
            lock (bufferLock)
            {
                try
                {
                    if (buffer != null)
                    {
                        var hasUpdated = false;

                        if (MessageLock != null)
                        {
                            lock (MessageLock)
                            {
                                hasUpdated = true;

                                MessageRenderer.DrawGifEmotes(buffer.Graphics, GifEmotesOnScreen, selection);
                            }
                        }

                        if (hasUpdated)
                        {
                            var borderPen = Selected ? App.ColorScheme.ChatBorderFocused : App.ColorScheme.ChatBorder;
                            buffer.Graphics.DrawRectangle(borderPen, 0, Height - 1, Width - 1, 1);

                            var g = CreateGraphics();

                            buffer.Render(g);

                            g.Dispose();
                        }
                    }
                }
                catch { }
            }
        }