private void loadbutton_Click(object sender, EventArgs e)
        {
            headerComboBox.Items.Clear();
            string userName = emailTextBox.Text.ToLower();

            this._userName = "";
            if (userName.Equals(""))
            {
                MessageBox.Show(@"Please give email address or username");
                return;
            }

            dropdownLoadProgressBar.Visible = true;
            pleaseWaitLabel.Visible         = true;
            dropdownLoadProgressBar.Value   = 0;

            string[] tokens = userName.Split('@');
            userName = tokens[0] + "@gmail.com";

            _service = _emailLoadManager.GetService(userName);
            List <Message> allMessageIds = _emailLoadManager.ListMessages(_service, userName, "");

            if (allMessageIds.Count == 0)
            {
                MessageBox.Show(@"No message found for this account");
                return;
            }

            dropdownLoadProgressBar.Maximum = allMessageIds.Count;
            List <Message> fullMessages = GetFullMessages(_service, userName, allMessageIds);

            _allMessageInformation = fullMessages;
            this._userName         = userName;

            HashSet <string> uniqueHeadersinHashSet = _emailLoadManager.GetUniqueHeaders(fullMessages);
            List <string>    uniqueHeader           = _emailLoadManager.GetHeaderInList(uniqueHeadersinHashSet);

            //headerComboBox.Items.Add("-------Select Subject of email------");
            foreach (string header in uniqueHeader)
            {
                headerComboBox.Items.Add(header);
            }

            dropdownLoadProgressBar.Visible = false;
            pleaseWaitLabel.Visible         = false;
        }
        private void loadbutton_Click(object sender, EventArgs e)
        {
            string         userName      = emailTextBox.Text;
            string         password      = passwordTextBox.Text;
            GmailService   service       = _emailLoadManager.GetService(userName, password);
            List <Message> allMessageIds = _emailLoadManager.ListMessages(service, userName, "");;
            List <Message> fullMessages  = _emailLoadManager.GetFullMessages(service, userName, allMessageIds);

            allMessageInformation = fullMessages;
            HashSet <string> uniqueHeadersinHashSet = _emailLoadManager.GetUniqueHeaders(fullMessages);
            List <string>    uniqueHeader           = _emailLoadManager.GetHeaderInList(uniqueHeadersinHashSet);

            headerComboBox.Items.Clear();
            foreach (string header in uniqueHeader)
            {
                headerComboBox.Items.Add(header);
            }
        }