void Reset(object parameter)
 {
     IssueReportHelper.LogOut();
     LoggedIn        = false;
     cmbRepositories = new List <Repository>();
     gridItems       = null;
     _totalIssues    = 0;
 }
예제 #2
0
        private void bw_LoginDoWork(object sender, DoWorkEventArgs e)
        {
            LoggedIn = IssueReportHelper.Login(txtUserID, txtPassword);

            DataAccess.Repository allrep = new DataAccess.Repository();
            allrep.Name = "ALL REPOSITORIES";
            cmbRepositories.Add(allrep);

            cmbRepositories.AddRange(GetRepositories());
        }
        public void SaveWindowInfo()
        {
            _cfgAcccess.IssuesCredential.userid   = IssueReportHelper.EncryptString(txtUserID);
            _cfgAcccess.IssuesCredential.password = IssueReportHelper.EncryptString(txtPassword);

            List <Repository> repositories = new List <Repository>(_cfgAcccess.Repositories);

            foreach (Issue issue in gridItems)
            {
                int nIndex = 0;
                foreach (Repository rep in _cfgAcccess.Repositories)
                {
                    if (issue.Repository.CompareTo(rep.Name) == 0)
                    {
                        int  nCount = 0;
                        bool bExist = false;
                        if (rep.githubissues != null)
                        {
                            foreach (GithubIssue gitissue in rep.githubissues)
                            {
                                if (gitissue.number == issue.Number)
                                {
                                    _cfgAcccess.Repositories[nIndex].githubissues[nCount].assignee = issue.Assignee;
                                    bExist = true;
                                    break;
                                }
                                nCount++;
                            }
                        }
                        if (!bExist)
                        {
                            GithubIssue [] array   = _cfgAcccess.Repositories[nIndex].githubissues;
                            int            newsize = _cfgAcccess.Repositories[nIndex].githubissues != null? _cfgAcccess.Repositories[nIndex].githubissues.Length + 1:1;
                            Array.Resize(ref array, newsize);
                            GithubIssue ghIssue = new GithubIssue();
                            ghIssue.assignee   = issue.Assignee;
                            ghIssue.number     = issue.Number;
                            array[newsize - 1] = ghIssue;
                            _cfgAcccess.Repositories[nIndex].githubissues = array;
                        }
                        else
                        {
                            continue;
                        }
                    }
                    nIndex++;
                }
            }
            //_cfgAcccess.Repositories = cmbRepositories;

            _cfgAcccess.SelectedRepository = SelectedRepository;

            _cfgAcccess.SavetoConfigData();
        }
        public void Initialize()
        {
            if (_cfgAcccess.LoadConfigData())
            {
                txtUserID       = IssueReportHelper.DecryptString(_cfgAcccess.IssuesCredential.userid);
                txtPassword     = IssueReportHelper.DecryptString(_cfgAcccess.IssuesCredential.password);
                cmbRepositories = _cfgAcccess.Repositories;

                SelectedRepository = _cfgAcccess.SelectedRepository;
            }
        }
 public List <Issue> GetIssues()
 {
     return(IssueReportHelper.GetIssues(SelectedRepository, SelectedReportType).Result);
 }
 public List <Repository> GetRepositories()
 {
     return(IssueReportHelper.GetRepositories().Result);
 }