Esempio n. 1
0
        public MainWindow()
        {
            if (!Debugger.IsAttached)
            {
                AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            }

            m_options            = new ChatOptions();
            m_playSounds         = m_options.GetOption("PlaySounds", true);
            m_highlightQuestions = m_options.GetOption("HighlightQuestions", true);
            m_confirmBans        = m_options.GetOption("ConfirmBans", true);
            m_confirmTimeouts    = m_options.GetOption("ConfirmTimeouts", false);
            m_showIcons          = m_options.GetOption("ShowIcons", true);
            m_showTimestamp      = m_options.GetOption("ShowTimestamps", false);
            m_fontSize           = 14;
            OnTop     = m_options.GetOption("OnTop", false);
            m_channel = m_options.Stream.ToLower();
            TwitchHttp.Instance.PollChannelData(m_channel);
            TwitchHttp.Instance.ChannelDataReceived += Instance_ChannelDataReceived;

            m_thread = new Thread(ThreadProc);
            m_thread.Start();

            Messages = new ObservableCollection <ChatItem>();

            InitializeComponent();
            Channel.Text = m_channel;
            ChatInput.Focus();
        }
Esempio n. 2
0
        public MainWindow()
        {
            if (!Debugger.IsAttached)
            {
                AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            }

            m_options            = new ChatOptions();
            m_playSounds         = m_options.GetOption("PlaySounds", true);
            m_highlightQuestions = m_options.GetOption("HighlightQuestions", true);
            m_confirmBans        = m_options.GetOption("ConfirmBans", true);
            m_confirmTimeouts    = m_options.GetOption("ConfirmTimeouts", false);
            m_showIcons          = m_options.GetOption("ShowIcons", true);
            m_showTimestamp      = m_options.GetOption("ShowTimestamps", false);
            m_fontSize           = 14;
            OnTop         = m_options.GetOption("OnTop", false);
            m_channelName = m_options.Stream.ToLower();


            LoadAsyncData();

            DispatcherTimer dispatcherTimer = new DispatcherTimer();

            dispatcherTimer.Tick    += new EventHandler(dispatcherTimer_Tick);
            dispatcherTimer.Interval = new TimeSpan(0, 2, 0);
            dispatcherTimer.Start();

            Messages = new ObservableCollection <ChatItem>();

            InitializeComponent();
            Channel.Text = m_channelName;
            ChatInput.Focus();
        }
Esempio n. 3
0
 private void ChatHistoryTextInput(object sender, TextCompositionEventArgs e)
 {
     // Redirect input from the chat history to the chat input
     ChatInput.Focus();
     ChatInput.SelectedText = e.Text;
     ChatInput.Select(ChatInput.SelectionStart + e.Text.Length, 0);
 }
Esempio n. 4
0
 private void Channel_PreviewKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         e.Handled = true;
         UpdateChannel(Channel.Text);
         ChatInput.Focus();
     }
 }
 void OnHistoryTextInput(object sender, TextCompositionEventArgs e)
 {
     ChatInput.SelectedText = e.Text;
     ChatInput.Select(ChatInput.SelectionStart + ChatInput.SelectionLength, 0);
     ChatInput.Focus();
 }