Exemplo n.º 1
0
        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);
                }
            }
        }
Exemplo n.º 2
0
        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();
            }
        }
Exemplo n.º 3
0
		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);
			}
		}
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
 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);
             }
         });
     }
 }
Exemplo n.º 6
0
		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);
				}
			}
		}
Exemplo n.º 7
0
		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();
			}
		}