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