Exemplo n.º 1
0
        private async void ConnectButton_Click(object sender, EventArgs e)
        {
            try
            {
                await Global.Kuro.ConnectAsync(TokenBox.Text.Trim());

                Global.Kuro.Client.Ready += async() =>
                {
                    await ControlHandler.AddTabsAsync();
                };
                Program.UserInterface.ConnectedMessageAddButton.Enabled = true;
                Program.UserInterface.FileSendButton.Enabled            = true;
                Program.UserInterface.ConnectButton.Enabled             = false;
                Program.UserInterface.DisconnectButton.Enabled          = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error happened while logging in!" + ex.Message);
            }
        }