public DocDownloadWnd()
        {
            InitializeComponent();

            _downloadingHandler = new DownloadTaskHandler(this);

            _companyList = new Dictionary <string, string>();
            string companies = Properties.Settings.Default.CompanyList;

            string[] companylist = companies.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string comp in companylist)
            {
                string[] company = comp.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
                if (company.Length == 2)
                {
                    _companyList.Add(company[0], company[1]);
                }
            }

            _documentTypeList = new Dictionary <string, string>();
            _documentTypeList.Add("E", "Prospectus");
            _documentTypeList.Add("D", "Annual Report");

            listViewDocuments.VirtualMode     = true;
            listViewDocuments.VirtualListSize = 0;

            timerRefresh.Interval = 7500;
            timerRefresh.Enabled  = false;
            this.Width            = 1024;
        }
Esempio n. 2
0
        public DocDownloadTask(string docId, string name, string docType, string companyId, string downloadFolder, string para, DownloadTaskHandler handler)
        {
            _docId              = docId;
            _name               = name;
            _casperPara         = para;
            _downloadingHandler = handler;
            _docType            = docType;
            _companyId          = companyId;
            _downloadFolder     = downloadFolder;


            _status = DocDownloadStatus.New;
            _downloadFailedTimes = 0;
            _percentage          = "";
        }
Esempio n. 3
0
        public DocPageTask(int id, string docType, string pageURL, string companyId, int year,
                           List <string> filterMonths, string downloadFolder, DownloadTaskHandler handler)
        {
            _id                 = id;
            _docType            = docType;
            _pageURL            = pageURL;
            _companyId          = companyId;
            _year               = year;
            _months             = filterMonths;
            _downloadFolder     = downloadFolder;
            _downloadingHandler = handler;

            _docCountNeedDownload = -1;
            _docCountDownloaded   = -1;
            _docCountOnPage       = -1;
            _docCountUrlReady     = -1;

            _docDownloadTasks = new Dictionary <string, DocDownloadTask>();
        }