예제 #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            if (!Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Downloads"))
            {
                Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Downloads");
            }

            _downloadManager = new BitsManager();
            _downloadManager.OnJobModified    += downloadManager_OnJobModified;
            _downloadManager.OnJobTransferred += downloadManager_OnJobTransferred;
            _downloadManager.EnumJobs(JobOwner.CurrentUser);

            foreach (var job in _downloadManager.Jobs.Values)
            {
                if (job.State == JobState.Transferred)
                {
                    job.Complete();
                }
                else
                {
                    AddJobFlags(job);
                }
            }

            _colIDs = new ColumnIDs(dataGridView1);

            dataGridView1.Rows.AddRange(GetDownloadJobsAsRows().ToArray());
        }
예제 #2
0
파일: Form1.cs 프로젝트: schraubchen/BITSDL
        private void Form1_Load(object sender, EventArgs e)
        {
            if (!Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Downloads"))
                Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Downloads");

            _downloadManager = new BitsManager();
            _downloadManager.OnJobModified += downloadManager_OnJobModified;
            _downloadManager.OnJobTransferred += downloadManager_OnJobTransferred;
            _downloadManager.EnumJobs(JobOwner.CurrentUser);

            foreach (var job in _downloadManager.Jobs.Values)
            {
                if (job.State == JobState.Transferred)
                    job.Complete();
                else
                    AddJobFlags(job);
            }

            _colIDs = new ColumnIDs(dataGridView1);

            dataGridView1.Rows.AddRange(GetDownloadJobsAsRows().ToArray());
        }