private void Window_Loaded(object sender, RoutedEventArgs ev) { _panels.Add(ConsolePanel); // Configure console panel if (_configuration.MainWindowConfiguration.ShowConsolePanelOnStartup) { ConsoleTab.Visibility = Visibility.Visible; ConsolePanel.Visibility = Visibility.Visible; _currentPanel = ConsolePanel; } #if DEBUG if (_configuration.DebuggingConfiguration.ShowDebuggingOutputInConsoleTab) { IIrcPanel panel; if (AddPanel("Debug", "Debug", "DebugPanel", out _debugTab, out panel)) { _panels.Add(panel); _debugPanel = (DebugPanel)panel; _debugPanel.DebuggingOutputEnabled = true; } } #endif ConsolePanel.InputProcessor = InputProcessor; }
private void Window_Loaded( object sender, RoutedEventArgs ev ) { _panels.Add( ConsolePanel ); // Configure console panel if ( _configuration.MainWindowConfiguration.ShowConsolePanelOnStartup ) { ConsoleTab.Visibility = Visibility.Visible; ConsolePanel.Visibility = Visibility.Visible; _currentPanel = ConsolePanel; } #if DEBUG if ( _configuration.DebuggingConfiguration.ShowDebuggingOutputInConsoleTab ) { IIrcPanel panel; if ( AddPanel( "Debug", "Debug", "DebugPanel", out _debugTab, out panel ) ) { _debugPanel = (DebugPanel) panel; _debugPanel.DebuggingOutputEnabled = true; _debugPanel.InputProcessor = InputProcessor; } } #endif ConsolePanel.InputProcessor = InputProcessor; }
// // Protected methods // protected virtual bool AddPanel( string name, string header, string type, out TabItem newTabItem, out IIrcPanel newPanel ) { newPanel = IrcPanelFactory.Create( type ); if ( null == newPanel ) { Debug.Print( "MainWindow.AddPanel: Couldn't construct new panel of type '{0}'", type ); newTabItem = null; return false; } newTabItem = new TabItem { Name = name, Header = header, Content = newPanel, }; TabControl.Items.Add( newTabItem ); return true; }
// // Protected methods // protected virtual bool AddPanel(string name, string header, string type, out TabItem newTabItem, out IIrcPanel newPanel) { newPanel = IrcPanelFactory.Create(type); if (null == newPanel) { Debug.Print("MainWindow.AddPanel: Couldn't construct new panel of type '{0}'", type); newTabItem = null; return(false); } newTabItem = new TabItem { Name = name, Header = header, Content = newPanel, }; TabControl.Items.Add(newTabItem); return(true); }