Exemple #1
0
        private async void btnGet_Click(object sender, System.EventArgs e)
        {
            Program.GetZulipClient();
            Streams streams = new Streams(Program.client);

            try {
                await streams.GetStreamsAsync();

                dgvStreams.DataSource = streams.StreamCollection;
                txtResponse.Text      = streams.JsonOutput;
            } catch (System.Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #2
0
        private async void lnkFillCombos_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Program.GetZulipClient();
            try {
                Users users = new Users(Program.client);
                await users.GetUsersAsync();

                cboUsers.DisplayMember = nameof(User.FullName);
                cboUsers.ValueMember   = nameof(User.Email);
                cboUsers.DataSource    = users.UserCollection;

                Streams streams = new Streams(Program.client);
                await streams.GetStreamsAsync();

                cboStreams.DisplayMember = nameof(Stream.Name);
                cboStreams.ValueMember   = nameof(Stream.Name);
                cboStreams.DataSource    = streams.StreamCollection;
            } catch (System.Exception ex) {
                MessageBox.Show(ex.ToString());
            }
        }