Exemplo n.º 1
0
        internal void InternalOpen(IUIPanel parentPanel, IPanelGroup group, IUIHandleInternal handle, string panelName, int index)
        {
            var    Content   = parentPanel == null ? null : parentPanel.Content;
            Bridge bridgeObj = group.InstencePanel(parentPanel, panelName, index, Content);

            if (bridgeObj != null)
            {
                handle.RegistCreate(OnCreate);
                handle.RegistClose(OnClose);
                handle.RegistBridge(bridgeObj);
            }
        }
        internal bool InternalOpen(IUIPanel parentPanel, IPanelGroup group, IUIHandleInternal handle, string panelName, int index)
        {
            var Content = parentPanel == null ? null : parentPanel.Content;

            UIInfoBase uiInfo;

            group.Nodes.TryGetValue(panelName, out uiInfo);

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

            Bridge bridge;


            if (group.TryOpenOldPanel(panelName, uiInfo, parentPanel, out bridge))
            {
                handle.RegistCreate(OnCreate);
                handle.RegistClose(OnClose);
                handle.RegistBridge(bridge);
                return(true);
            }
            else
            {
                if (group.CreateInfoAndBridge(panelName, parentPanel, index, uiInfo, out bridge))
                {
                    handle.RegistCreate(OnCreate);
                    handle.RegistClose(OnClose);
                    handle.RegistBridge(bridge);

                    group.CreatePanel(uiInfo, bridge, parentPanel);
                    return(true);
                }
            }

            return(false);
        }