コード例 #1
0
        public IComposerSequence Close(
            string name)
        {
            var panel = composer.GetPanel(name);

            Requires.NotNull(panel, nameof(panel));

            if (modesController.TryGetPanelInfo(panel, out var panelInfo) == false)
            {
                return(this);
            }

            ICommand command;

            if (panelInfo.Mode == Modes.Modal)
            {
                command = new CommandClosePanelModal(panel, modesController);
            }
            else
            {
                command = new CommandClosePanelNone(panel, modesController);
            }

            sequence.Add(command);

            return(this);
        }
コード例 #2
0
        private void CreateCloseCommands()
        {
            foreach (var name in closingPanels)
            {
                var panel = composer.GetPanel(name);
                Requires.NotNull(panel, nameof(panel));

                if (modesController.TryGetPanelInfo(panel, out var panelInfo) == false)
                {
                    continue;
                }

                ICommand command;

                if (panelInfo.Mode == Modes.Modal)
                {
                    command = new CommandClosePanelModal(panel, modesController);
                }
                else
                {
                    command = new CommandClosePanelNone(panel, modesController);
                }

                batch.Add(command);
            }
        }