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); } }
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); }