Exemplo n.º 1
0
        private void DisplayIssues(string filterId, int page)
        {
            lbCurrentAction.Text = "Getting issues...";
            var mantisConnector =
                new org.mantisbt.www.MantisConnect(_settings.RepositoryUri.ToString() + _settings.WebServicePath);

            mantisConnector.mc_project_get_issuesCompleted += (s, e) =>
            {
                try
                {
                    DisplayIssues(page, e.Result, e.Error, e.Cancelled);
                    _currentFilter = filterId;
                }
                catch (Exception)
                {
                    MessageBox.Show("Error obteniendo datos: " + e.Error.Message, "Error");
                }

                mantisConnector.Dispose();
            };

            mantisConnector.mc_filter_get_issuesCompleted += (s, e) =>
            {
                try
                {
                    DisplayIssues(page, e.Result, e.Error, e.Cancelled);
                    _currentFilter = filterId;
                }
                catch (Exception)
                {
                    MessageBox.Show("Error obteniendo datos: " + e.Error.Message, "Error");
                }

                mantisConnector.Dispose();
            };

            if (filterId == "-1")
            {
                mantisConnector.mc_project_get_issuesAsync(_settings.UserName, _settings.Password, _settings.ProjectId.ToString(),
                                                           page.ToString(), _settings.IssuesPerPage.ToString());
            }
            else
            {
                mantisConnector.mc_filter_get_issuesAsync(_settings.UserName, _settings.Password, _settings.ProjectId.ToString(),
                                                          filterId, page.ToString(), _settings.IssuesPerPage.ToString());
            }
        }
Exemplo n.º 2
0
        public void LoadData(ConnectorSettings settings)
        {
            _settings = settings;

            if (_settings.LocalAccount)
            {
                var settingsManager = new ConnectorSettingsManager();
                settingsManager.LoadLocalUserSettings(_settings);
            }

            InitializeStatusColorMapping();

            var mantisConnector =
                new org.mantisbt.www.MantisConnect(settings.RepositoryUri.ToString() + _settings.WebServicePath);

            mantisConnector.mc_filter_getCompleted += (s, e) =>
            {
                var filters    = e.Result;
                var filterData = new org.mantisbt.www.FilterData()
                {
                    name = "[No filter]", id = "-1"
                };
                Array.Reverse(filters);
                Array.Resize(ref filters, filters.Length + 1);
                Array.Reverse(filters);
                filters[0] = filterData;
                tscbFilter.ComboBox.DataSource    = filters;
                tscbFilter.ComboBox.DisplayMember = "name";

                mantisConnector.Dispose();
            };

            lbCurrentAction.Text = "Getting filters...";

            mantisConnector.mc_filter_getAsync(settings.UserName, settings.Password, settings.ProjectId.ToString());
        }