Ejemplo n.º 1
0
        //=========================================================
        //  Projects
        //=========================================================
        private void buttonProjects_Click(object sender, EventArgs e)
        {
            InitRequestResponse();
            this.Update();

            m_proj_list = Glue.ProjectList(m_authToken);

            ShowRequestResponse();

            if (m_proj_list == null)
            {
                return;
            }

            // Set up a project list
            m_proj_list = m_proj_list.OrderBy(x => x.project_name).ToList();
            comboBoxProjects.DataSource    = new BindingSource(m_proj_list, null);
            comboBoxProjects.DisplayMember = "project_name";
            comboBoxProjects.ValueMember   = "project_id";
            comboBoxProjects.SelectedIndex = 0;
        }
Ejemplo n.º 2
0
        private void buttonProjects_Click(object sender, EventArgs e)
        {
            textBoxRequest.Text  = "Request comes here";
            textBoxResponse.Text = "Response comes here";

            List <Project> proj_list = glueCall.ProjectList(m_authToken);

            // Show the request and response in the form.
            // This is for learning purpose.
            IRestResponse response = glueCall.m_lastResponse;

            textBoxRequest.Text  = response.ResponseUri.AbsoluteUri;
            textBoxResponse.Text = response.Content;

            // We want to get hold of one project.
            // For simplicity, just pick up arbitrary one.
            m_proj_index %= proj_list.Count;
            Project proj = proj_list[m_proj_index++];

            m_project_id = proj.project_id;
            string project_name = proj.project_name;

            labelCurProj.Text = project_name + " (" + m_proj_index.ToString() + "/" + proj_list.Count.ToString() + ")";
        }