public static void Create(IrcSession session, ChatPage page, bool makeActive) { if (App.Settings.Current.Windows.States.Exists(page.Id) ? App.Settings.Current.Windows.States[page.Id].IsDetached : App.Settings.Current.Windows.DefaultQueryDetached) { var newWin = new ChannelWindow(page); if (!makeActive) { newWin.ShowActivated = false; newWin.WindowState = WindowState.Minimized; } newWin.Show(); if (makeActive) { newWin.Activate(); } else { Interop.WindowHelper.FlashWindow(newWin); } } else { var window = App.Current.MainWindow as ChatWindow; window.AddPage(page, makeActive); if (!window.IsActive) { Interop.WindowHelper.FlashWindow(window); } } }
private void ExecuteDetach(object sender, ExecutedRoutedEventArgs e) { var item = e.Parameter as ChatTabItem; if (item != null && item.Page.Type != ChatPageType.Server) { this.Items.Remove(item); var ctrl = item.Content; item.Content = null; var window = new ChannelWindow(item.Page); window.Show(); } }
private void Session_SelfJoined(object sender, IrcJoinEventArgs e) { var page = new ChatControl(ChatPageType.Chat, (IrcSession)sender, e.Channel); var state = App.Settings.Current.Windows.States[page.Id]; if (state.IsDetached) { var window = new ChannelWindow(page); window.Show(); } else { this.AddPage(page, true); } }
private void Session_Joined(object sender, IrcChannelEventArgs e) { if (e.IsSelf) { this.Invoke(() => { var context = new ChatContext((IrcSession)sender, e.Channel); var state = App.Settings.Current.Windows.States[context.Key]; if (state.IsDetached) { var window = new ChannelWindow(new ChatControl(context)); window.Show(); } else { this.AddPage(context, true); } }); } }