Example #1
0
        public bool TryGetPanelInfo(
            IPanel panel,
            out PanelInfo panelInfo)
        {
            var result = false;

            if (panel != null)
            {
                panelInfo = openPanels.Find(info => info.Panel == panel);
                result    = panelInfo != null;
            }
            else
            {
                panelInfo = null;
            }

            return(result);
        }
Example #2
0
        private void Add(
            IPanel panel)
        {
            Requires.NotNull(panel, nameof(panel));

            var panelInfo = openPanels.Find(info => info.Panel == panel);

            if (panelInfo != null)
            {
                openPanels.Remove(panelInfo);
                openPanels.Add(panelInfo);
            }
            else
            {
                panelInfo = new PanelInfo(panel, Modes.None);
                openPanels.Add(panelInfo);
            }
        }
Example #3
0
        private void AddModal(
            IPanel panel)
        {
            Requires.NotNull(panel, nameof(panel));

            var panelInfo = openPanels.Find(info => info.Panel == panel);

            if (panelInfo != null)
            {
                openPanels.Remove(panelInfo);
            }

            panelInfo = new PanelInfo(panel, Modes.Modal);

            foreach (var info in openPanels)
            {
                info.Panel.IsInteractable = false;
            }

            openPanels.Add(panelInfo);
        }