Ejemplo n.º 1
0
        private async void ChannelButton_Click(object sender, RoutedEventArgs e)
        {
            //MessageDialog md = new MessageDialog("选择频道");
            //if (ChannelId != 110)
            //    md.Commands.Add(new UICommand("综合", ChannelSelectAction, 110));
            //if (ChannelId != 73)
            //    md.Commands.Add(new UICommand("工作·情感", ChannelSelectAction, 73));
            //if (ChannelId != 74)
            //    md.Commands.Add(new UICommand("动漫·文化", ChannelSelectAction, 74));
            //if (!PlatformHelper.IsMobile)
            //{
            //    if (ChannelId != 75)
            //        md.Commands.Add(new UICommand("漫画·轻小说", ChannelSelectAction, 75));
            //}
            //await md.ShowAsync();

            var channelBox = new ChannelBox();

            channelBox.ChannelSelectedAction = i =>
            {
                ChannelId = i;
                GetChannelListData(true);
            };
            await channelBox.ShowAsync();
        }
Ejemplo n.º 2
0
        private void TsTwitch_Click(object sender, EventArgs e)
        {
            TabPage x = (TabPage)this.tabpagemenu.Tag;

            //if (!(0 < (from TabPage tab in this.tabControl1.TabPages where (0 < (from RichTextBox box in tab.Controls where box.Name == "TwitchChat" select box).Count()) select tab).Count())) {
            if (!(0 < x.Controls.Count))
            {
                x.Controls.Clear();
                Logger.Write("Cleared controls of Tab " + x.Name, ArtLogger.Logging.LogLevel.Info);

                this.TwitchChat                   = new RichTextBox();
                this.TwitchChat.Name              = "TwitchChat";
                this.TwitchChat.Anchor            = (AnchorStyles.Bottom | AnchorStyles.Right);
                this.TwitchChat.Dock              = DockStyle.Fill;
                this.TwitchChat.Font              = new Font("Verdana", 9);
                this.TwitchChat.ForeColor         = Color.White;
                this.TwitchChat.BackColor         = Color.Black;
                this.TwitchChat.MouseDoubleClick += TwitchChat_MouseDoubleClick;
                this.TwitchChat.ReadOnly          = true;
                this.TwitchChat.WordWrap          = true;
                this.TwitchChat.Disposed         += TwitchChat_Disposed;

                x.Controls.Add(this.TwitchChat);
                Logger.Write("Added TwitchChat to Tab " + x.Name, ArtLogger.Logging.LogLevel.Info);

                //this.TwitchClient = new twitch.TwitchClient("mrep1cman", "mrep1cman");
                String chan = new ChannelBox("Input channel").ShowDialog(true);
                String nick = new ChannelBox("Input nickname").ShowDialog(true);
                this.TwitchClient = new TwitchClient(chan, nick);
                this.TwitchClient.OnChatConnected += TwitchClient_OnChatConnected;
                this.TwitchClient.OnDataRecieved  += TwitchClient_OnDataRecieved;

                this.TwitchClient.Connect();

                this.TwitchClient.StartListener(TwitchClient);
            }
            else
            {
                Logger.Write("Tab " + x.Name + " already contains " + x.Controls[0].GetType(), ArtLogger.Logging.LogLevel.Warning);
            }
        }
Ejemplo n.º 3
0
 public void FocusMessageBox()
 {
     ChannelBox.SelectAll();
     MessageBox.Focus();
 }