public IShellView Run() { Initialize(); ShellService.ShellView = Shell.View as IShellView; ShellService.ExitCommand = new RelayCommand(Exit); ShellService.OpenQueueManagerCommand = new RelayCommand(() => OpenLocalQueueManager(), IsLocalQmInstalled); ShellService.OpenQueueCommand = new RelayCommand(() => OpenLocalQueue(), IsLocalQmInstalled); ShellService.OpenRemoteQueueManagerCommand = new RelayCommand(() => OpenRemoteQueueManager()); ShellService.OpenRemoteQueueCommand = new RelayCommand(() => OpenRemoteQueue()); ShellService.ShowSettingsCommand = new RelayCommand(ShowSettings); ShellService.ShowAboutCommand = new RelayCommand(ShowAbout); ShellService.UseRecentConnectionCommand = new RelayCommand <RecentConnection>(UseRecentConnection); ShellService.ClearRecentConnectionsCommand = new RelayCommand(ClearRecentConnections, () => UserSettings.RecentConnections.Count > 0); ShellService.ShowParserEditorCommand = new RelayCommand(ShowParsingEditor); MessageService.Before += (s, e) => { ShellService.DisableAutomaticRefresh(); }; MessageService.After += (s, e) => { ShellService.EnableAutomaticRefresh(); }; if (ShellService.ShellView != null) { WeakEventManager <IShellView, CancelEventArgs> .AddHandler(ShellService.ShellView, "Closing", ShellView_Closing); } return(ShellService.ShellView); }
void Modal_Closing(object sender, EventArgs e) { ShellService.EnableAutomaticRefresh(); }