Exemplo n.º 1
0
    private void BindPopUpWindowDelegates(AbstractPopUpPanel displayPanel, AbstractPopUpPanel.OnUIButtonPressed confirmButtonPressed, AbstractPopUpPanel.OnUIButtonPressed cancelButtonPressed)
    {
        if (confirmButtonPressed != null)
        {
            displayPanel.popUpPanelData.confirmButtonPressedCallback += (panel) => confirmButtonPressed(panel);
        }

        displayPanel.popUpPanelData.confirmButtonPressedCallback += ClosePopUpWindow;

        if (cancelButtonPressed != null)
        {
            displayPanel.popUpPanelData.cancelButtonPressedCallback += (panel) => cancelButtonPressed(panel);
        }

        displayPanel.popUpPanelData.cancelButtonPressedCallback += ClosePopUpWindow;
    }
Exemplo n.º 2
0
    public void DispatchPopUp <T>(string title, string message, PopUpPriority popUpPriority = PopUpPriority.MediumPriority, AbstractUIPanel ownerPanel = null, AbstractPopUpPanel.OnUIButtonPressed confirmButtonPressedCallback = null, AbstractPopUpPanel.OnUIButtonPressed cancelButtonPressedCallback = null, params object[] data) where T : AbstractPopUpPanel
    {
        var popUpPanelData = new AbstractPopUpPanel.PopUpPanelData();

        popUpPanelData.title   = title;
        popUpPanelData.message = message;
        popUpPanelData.confirmButtonPressedCallback = confirmButtonPressedCallback;
        popUpPanelData.cancelButtonPressedCallback  = cancelButtonPressedCallback;
        popUpPanelData.ownerPanel = ownerPanel;
        popUpPanelData.data       = data;

        DispatchPopUp <T>(popUpPanelData, popUpPriority);
    }