public void RegisterDebuggerWindow(string path, IDebuggerWindow debuggerWindow)
            {
                if (string.IsNullOrEmpty(path))
                {
                    throw new GameFrameworkException("Path is invalid.");
                }
                int num = path.IndexOf('/');

                if (num < 0 || num >= path.Length - 1)
                {
                    if (this.InternalGetDebuggerWindow(path) != null)
                    {
                        throw new GameFrameworkException("Debugger window has been registered.");
                    }
                    this.m_DebuggerWindows.Add(new KeyValuePair <string, IDebuggerWindow>(path, debuggerWindow));
                    this.RefreshDebuggerWindowNames();
                }
                else
                {
                    string text  = path.Substring(0, num);
                    string path2 = path.Substring(num + 1);
                    DebuggerManager.DebuggerWindowGroup debuggerWindowGroup = (DebuggerManager.DebuggerWindowGroup) this.InternalGetDebuggerWindow(text);
                    if (debuggerWindowGroup == null)
                    {
                        if (this.InternalGetDebuggerWindow(text) != null)
                        {
                            throw new GameFrameworkException("Debugger window has been registered, can not create debugger window group.");
                        }
                        debuggerWindowGroup = new DebuggerManager.DebuggerWindowGroup();
                        this.m_DebuggerWindows.Add(new KeyValuePair <string, IDebuggerWindow>(text, debuggerWindowGroup));
                        this.RefreshDebuggerWindowNames();
                    }
                    debuggerWindowGroup.RegisterDebuggerWindow(path2, debuggerWindow);
                }
            }
            /// <summary>
            /// 解除注册调试器窗口。
            /// </summary>
            /// <param name="path">调试器窗口路径。</param>
            /// <returns>是否解除注册调试器窗口成功。</returns>
            public bool UnregisterDebuggerWindow(string path)
            {
                if (string.IsNullOrEmpty(path))
                {
                    return(false);
                }

                int pos = path.IndexOf('/');

                if (pos < 0 || pos >= path.Length - 1)
                {
                    IDebuggerWindow debuggerWindow = InternalGetDebuggerWindow(path);
                    bool            result         = m_DebuggerWindows.Remove(new KeyValuePair <string, IDebuggerWindow>(path, debuggerWindow));
                    debuggerWindow.Shutdown();
                    RefreshDebuggerWindowNames();
                    return(result);
                }

                string debuggerWindowGroupName = path.Substring(0, pos);
                string leftPath = path.Substring(pos + 1);
                DebuggerWindowGroup debuggerWindowGroup = (DebuggerWindowGroup)InternalGetDebuggerWindow(debuggerWindowGroupName);

                if (debuggerWindowGroup == null)
                {
                    return(false);
                }

                return(debuggerWindowGroup.UnregisterDebuggerWindow(leftPath));
            }
Exemple #3
0
 private void RegisterDebuggerWindow(string title, IDebuggerWindow window)
 {
     toolList.Add(title);
     if (window != null)
     {
         window.Initialize();
         windowList.Add(window);
     }
 }
 public void Add(IDebuggerWindow debuggerWindow)
 {
     if (debuggerWindow.ViewPort.Equals(DebuggerWindow.Default))
     {
         windows.Add(debuggerWindow);
     }
     else
     {
         customWindows.Add(debuggerWindow);
     }
 }
 public void RegisterDebuggerWindow(string path, IDebuggerWindow debuggerWindow, params object[] args)
 {
     if (string.IsNullOrEmpty(path))
     {
         throw new GameFrameworkException("Path is invalid.");
     }
     if (debuggerWindow == null)
     {
         throw new GameFrameworkException("Debugger window is invalid.");
     }
     this.m_DebuggerWindowRoot.RegisterDebuggerWindow(path, debuggerWindow);
     debuggerWindow.Initialize(args);
 }
            /// <summary>
            /// 注册调试器窗口。
            /// </summary>
            /// <param name="path">调试器窗口路径。</param>
            /// <param name="debuggerWindow">要注册的调试器窗口。</param>
            public void RegisterDebuggerWindow(string path, IDebuggerWindow debuggerWindow)
            {
                if (string.IsNullOrEmpty(path))
                {
                    throw new GameFrameworkException("Path is invalid.");
                }

                int pos = path.IndexOf('/');

                if (pos < 0 || pos >= path.Length - 1)
                {
                    if (InternalGetDebuggerWindow(path) != null)
                    {
                        throw new GameFrameworkException("Debugger window has been registered.");
                    }

                    m_DebuggerWindows.Add(new KeyValuePair <string, IDebuggerWindow>(path, debuggerWindow));
                    RefreshDebuggerWindowNames();
                }
                else
                {
                    string debuggerWindowGroupName = path.Substring(0, pos);
                    string leftPath = path.Substring(pos + 1);
                    DebuggerWindowGroup debuggerWindowGroup = (DebuggerWindowGroup)InternalGetDebuggerWindow(debuggerWindowGroupName);
                    if (debuggerWindowGroup == null)
                    {
                        if (InternalGetDebuggerWindow(debuggerWindowGroupName) != null)
                        {
                            throw new GameFrameworkException("Debugger window has been registered, can not create debugger window group.");
                        }

                        debuggerWindowGroup = new DebuggerWindowGroup();
                        m_DebuggerWindows.Add(new KeyValuePair <string, IDebuggerWindow>(debuggerWindowGroupName, debuggerWindowGroup));
                        RefreshDebuggerWindowNames();
                    }

                    debuggerWindowGroup.RegisterDebuggerWindow(leftPath, debuggerWindow);
                }
            }
Exemple #7
0
 /// <summary>
 /// 注册调试窗口。
 /// </summary>
 /// <param name="path">调试窗口路径。</param>
 /// <param name="debuggerWindow">要注册的调试窗口。</param>
 /// <param name="args">初始化调试窗口参数。</param>
 public void RegisterDebuggerWindow(string path, IDebuggerWindow debuggerWindow, params object[] args)
 {
     m_DebuggerManager.RegisterDebuggerWindow(path, debuggerWindow, args);
 }