/// <summary>
        /// The create debug console.
        /// </summary>
        private static void CreateDebugConsole()
        {
            lock (Instance().syncobj)
            {
                try
                {
                    if (((SBPlus.Current == null) || (DebugConsoleWindow != null)) || SBPlus.Current.IsSBPlusClosing)
                    {
                        return;
                    }

                    try
                    {
                        DebugConsoleWindow = new DebugConsoleWindow();
                        DebugConsoleWindow.Closed += DebugConsoleIsClosed;
                        DebugConsoleWindow.Show();
                        Dispatcher.Run();
                    }
                    catch (Exception exception)
                    {
                        SBPlusClient.LogError("An exception was caught when creating the Debug Console.", exception);
                        DebugConsoleWindow = null;
                    }
                }
                catch (Exception exception2)
                {
                    SBPlusClient.LogError("An exception was caught when creating the Debug Console.", exception2);
                }
            }
        }
        /// <summary>
        /// The debug console is closed.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private static void DebugConsoleIsClosed(object sender, EventArgs e)
        {
            if ((DebugConsoleWindow != null) && (DebugConsoleWindow.Dispatcher != null))
            {
                DebugConsoleWindow.Dispatcher.BeginInvokeShutdown(DispatcherPriority.Normal);
            }

            DebugConsoleWindow = null;
        }
        /// <summary>
        ///     The close debug console.
        /// </summary>
        public static void CloseDebugConsole()
        {
            if (DebugConsoleWindow == null)
            {
                return;
            }

            if (WindowTable.Count != 0)
            {
                WindowTable.Clear();
            }

            DebugConsoleWindow.Dispatcher.BeginInvokeShutdown(DispatcherPriority.Normal);
            DebugConsoleWindow = null;
        }