Florence.GtkSharp.PlotWidget.OnExposeEvent C# (CSharp) Method

OnExposeEvent() protected method

protected OnExposeEvent ( Gdk args ) : bool
args Gdk
return bool
        protected override bool OnExposeEvent(Gdk.EventExpose args)
        {
            Gdk.Rectangle area = args.Area;

            //Console.Write ("OnExposeEvent: ");
            //Console.WriteLine (area);

            if (this.IsDoubleBuffered) {
                // needed for interactions i.e. updating guide lines
                // otherwise UpdateCache () in RefreshRequested handler would be sufficient
                UpdateCache ();

                using (Graphics g = global::Gtk.DotNet.Graphics.FromDrawable (args.Window)) {
                    Rectangle bounds = new Rectangle (area.X, area.Y, area.Width, area.Height);

                    g.DrawImage (bitmap_cache, bounds, bounds, GraphicsUnit.Pixel);
                }
            } else {
                using (Graphics g = Gtk.DotNet.Graphics.FromDrawable (this.GdkWindow, false))
                {
                    Rectangle bounds = new Rectangle(0, 0, this.Allocation.Width, this.Allocation.Height);
                    this.InteractivePlotSurface2D.DoDraw (g, bounds);
                }
            }

            return true;
        }