Example #1
0
        /// <summary>
        /// Reload the display and its content.  Reloading will also delete any other resources we have.
        /// </summary>
        /// <param name="bHard">True if we want to remove and then re-create the webcontrol.  False if we just want to do a web-refresh.</param>
        /// <param name="bIgnoreCache">If this is just a web-refresh, do we want to ignore the cache.</param>
        public void Reload(bool bHard, bool bIgnoreCache = true)
        {
            // If it is active.
            if (ActiveControl == null)
            {
                return;
            }

            // If it is on a surface.
            if (ActiveSurface == null)
            {
                return;
            }

            // If it is a hard reset.
            if (bHard)
            {
                // Remove the control and re-add it.
                ActiveSurface.Display_SetVisual(null);
                ActiveControl.Dispose();
                ActiveControl = null;

                this.DeleteResources();
                ActiveControl = CreateRenderable();
                ActiveSurface.Display_SetVisual(ActiveControl);
            }
            else
            {
                this.DeleteResources();
                ActiveControl.Reload(bIgnoreCache);
            }
        }