예제 #1
0
        public ConnectedInterface(SlackSocketClient connectedClient, LoginResponse loginDetails)
        {
            Client = connectedClient;
            chats = new Dictionary<string, ChatInterface>();

            InitializeComponent();

            channelList = new SlackChannelList(this);
            channelList.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left;
            channelList.AutoScroll = true;
            channelList.BackColor = Color.FromArgb(0x4D, 0x39, 0x4B);
            channelList.Location = new Point(0, 52); //53
            channelList.Margin = new Padding(0);
            channelList.Name = "channelList";
            channelList.Size = new Size(220, 671);
            channelList.TabIndex = 2;
            channelList.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            Controls.Add(this.channelList);
            channelList.Flush();

            username = new Label()
            {
                Text = Client.MySelf.name,
                Location = new Point(64, 10),
                Size = new Size(120, 24),
                ForeColor = Color.White,
                Font = new Font(CustomFonts.Fonts.Families[1], 14, FontStyle.Bold),
                TextAlign = ContentAlignment.BottomLeft
            };

            userPicture = new CachedPictureBox(Client.MyData.profile.image_48);
            userPicture.Location = new Point(8, 8);
            userPicture.Size = new Size(48, 48);

            TeamName = new Label()
            {
                Text = Client.MyTeam.name,
                Size = new Size(188, 53),
                Location = new Point(16, 0),
                TextAlign = ContentAlignment.MiddleLeft,
                ForeColor = Color.White,
                Font = new Font(CustomFonts.Fonts.Families[1], 14, FontStyle.Bold)
            };

            profileTitle.Controls.Add(username);
            teamTitle.Controls.Add(TeamName);
            profileTitle.Controls.Add(userPicture);

            //Default to general channel.
            SelectChannel(Client.Channels[0].id);

            this.Invalidate();
        }
예제 #2
0
파일: Bot.cs 프로젝트: sigebacsi/kajabot
 private void _slackClient_OnConnected(LoginResponse obj)
 {
     _log.Info("Connected");
     _loginResponse = obj;
 }
예제 #3
0
 protected override void Connected(LoginResponse loginDetails)
 {
     this.loginDetails = loginDetails;
     base.Connected(loginDetails);
 }