MonoHotDraw.Figures.SimpleTextFigure.GenerateDummyContext C# (CSharp) Method

GenerateDummyContext() private method

private GenerateDummyContext ( ) : void
return void
        private void GenerateDummyContext()
        {
            // Generates a dummy Cairo.Context. This trick is necesary in order to get
            // a Pango.Layout before obtaining a valid Cairo Context, otherwise, we should
            // wait until Draw method is called. The Pango.Layout is neccesary for
            // RecalculateDisplayBox.
            ImageSurface surface = new ImageSurface (Cairo.Format.ARGB32, 100, 100);
            using (Cairo.Context dummycontext =  new Cairo.Context (surface)) {
                SetupLayout (dummycontext);
                RecalculateDisplayBox ();
            }
        }