MediaPortal.Dialogs.GUIDialogWindow.PageDestroy C# (CSharp) Method

PageDestroy() public method

public PageDestroy ( ) : void
return void
    public virtual void PageDestroy()
    {
      if (_running == false)
      {
        return;
      }

      try
      {
        GUIWindowManager.IsSwitchingToNewWindow = true;
        if (!_destroyingPage)
        {
          _destroyingPage = true;
          GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT, GetID, 0, 0, _parentWindowID, 0,
                                          null);
          OnMessage(msg);
          if (GUIWindowManager.RoutedWindow == GetID)
          {
            GUIWindowManager.UnRoute(); // only unroute if we still the routed window
          }
          _parentWindow = null;
          _running = false;
          _destroyingPage = false;
        }
        GUIWindowManager.IsSwitchingToNewWindow = false;
        while (IsAnimating(AnimationType.WindowClose) &&
               GUIGraphicsContext.CurrentState == GUIGraphicsContext.State.RUNNING)
        {
          GUIWindowManager.Process();
        }

      }
      catch (System.Exception ex)
      {
        _destroyingPage = false;
        Log.Error("Error during PageDestroy(): " + ex.Message);
      }
    }