private void issueDataGrid_SelectionChanged(object sender, EventArgs e)
        {
            JiraIssue selectedIssue;

            foreach (DataGridViewRow row in issueDataGrid.SelectedRows)
            {
                selectedIssue = row.DataBoundItem as JiraIssue;

                if (selectedIssue != null)
                {
                    toggleTimerControls(selectedIssue.ID != 0);
                    lbCurIssue.Text = selectedIssue.title;

                    currentIssue.secondsElapsed = timer.secondsPassed;
                    timer.secondsPassed         = selectedIssue.secondsElapsed;

                    currentIssue = selectedIssue;

                    if (timer.isRunning)
                    {
                        timer.stop();
                    }

                    tickHandler(sender, e);

                    break;
                }
            }
        }
        private void MainForm_Load(object sender, EventArgs e)
        {
            timer = new Timer();
            timer.setTickHandler(new EventHandler(tickHandler));

            this.mouseMessageFilter            = new MouseMoveMessageFilter();
            this.mouseMessageFilter.TargetForm = this;
            Application.AddMessageFilter(this.mouseMessageFilter);


            issuesFilterSource.Add(new JiraIssueFilter {
                title = "My Open Issues",
                ID    = -1,
                jql   = "assignee = currentUser() AND resolution = Unresolved ORDER BY updatedDate DESC"
            });
            issuesFilterSource.Add(new JiraIssueFilter {
                title = "Reported By Me",
                ID    = -2,
                jql   = "reporter = currentUser() ORDER BY createdDate DESC"
            });
            cbIssueFilters.DataSource = issuesFilterSource;

            currentIssue = new JiraIssue
            {
                ID    = 0,
                title = "No Issue selected",
                code  = "0"
            };
            issuesSource.Add(currentIssue);
            issueDataGrid.DataSource = issuesSource;


            if (lastConnectSuccess)
            {
                updateIssuesFilters();
                updateIssues();
            }
        }