Exemplo n.º 1
0
        private void LoadFilters()
        {
            Task.Factory.StartNew(
                () =>
            {
                List <Filter> filters = jiraClient.GetFavoriteFilters();
                if (filters == null)
                {
                    return;
                }

                filters.Insert(0, new Filter
                {
                    Id   = -1,
                    Name = "My open issues",
                    Jql  = "assignee = currentUser() AND resolution = Unresolved order by updated DESC"
                });

                if (filters.Count() > 1)
                {
                    filters.Insert(1, new Filter
                    {
                        Id   = 0,
                        Name = "--------------",
                        Jql  = ""
                    });
                }

                this.InvokeIfRequired(
                    () =>
                {
                    CBFilterItem currentItem = null;

                    cbFilters.Items.Clear();
                    foreach (var filter in filters)
                    {
                        var item = new CBFilterItem(filter.Id, filter.Name, filter.Jql);
                        cbFilters.Items.Add(item);
                        if (item.Id == this.settings.CurrentFilter)
                        {
                            currentItem = item;
                        }
                    }

                    if (currentItem != null)
                    {
                        cbFilters.SelectedItem = currentItem;
                    }
                }
                    );
            }
                );
        }
Exemplo n.º 2
0
        private void LoadFilterList()
        {
            Task.Factory.StartNew(
                () =>
            {
                List <Filter> filters = jiraClient.GetFavoriteFilters();
                if (filters == null)
                {
                    return;
                }

                this.InvokeIfRequired(
                    () =>
                {
                    CBFilterItem currentItem = null;

                    cbFilters.Items.Clear();
                    foreach (var filter in filters)
                    {
                        var item = new CBFilterItem(filter.Id, filter.Name, filter.Jql);
                        cbFilters.Items.Add(item);
                        if (item.Id == this.settings.CurrentFilter)
                        {
                            currentItem = item;
                        }
                    }

                    if (currentItem != null)
                    {
                        cbFilters.SelectedItem = currentItem;
                    }
                }
                    );
            }
                );
        }
Exemplo n.º 3
0
        private void LoadFilterList()
        {
            Task.Factory.StartNew(
                () =>
                {
                    List<Filter> filters = jiraClient.GetFavoriteFilters();
                    if (filters == null)
                        return;

                    this.InvokeIfRequired(
                        () =>
                        {
                            CBFilterItem currentItem = null;

                            cbFilters.Items.Clear();
                            foreach (var filter in filters)
                            {
                                var item = new CBFilterItem(filter.Id, filter.Name, filter.Jql);
                                cbFilters.Items.Add(item);
                                if (item.Id == this.settings.CurrentFilter)
                                   currentItem = item;
                            }

                            if (currentItem != null)
                                cbFilters.SelectedItem = currentItem;
                        }
                    );
                }
            );
        }