Beispiel #1
0
        private void CreateOpenCommands()
        {
            foreach (var name in openingPanels)
            {
                var panel = composer.GetPanel(name);
                Requires.NotNull(panel, nameof(panel));

                ICommand command;
                var      mode = openingModalPanels.Contains(name) ? Modes.Modal : Modes.None;

                if (mode == Modes.Modal)
                {
                    command = new CommandOpenPanelModal(panel, modesController);
                }
                else
                {
                    command = new CommandOpenPanelNone(panel, modesController);
                }

                batch.Add(command);
            }
        }
Beispiel #2
0
        public IComposerSequence Open(
            string name,
            Modes mode = Modes.None)
        {
            var panel = composer.GetPanel(name);

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

            ICommand command;

            if (mode == Modes.Modal)
            {
                command = new CommandOpenPanelModal(panel, modesController);
            }
            else
            {
                command = new CommandOpenPanelNone(panel, modesController);
            }

            sequence.Add(command);

            return(this);
        }