예제 #1
0
        private void barButtonItemSingle_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                bool valForm = false;
                foreach (var child in MdiChildren)
                {
                    if (child is frmReDownloadImage)
                    {
                        var f = (frmReDownloadImage)child;

                        child.BringToFront();
                        valForm = true;
                        break;
                    }
                }
                if (!valForm)
                {
                    try
                    {
                        frmReDownloadImage frm = new frmReDownloadImage();
                        frm.MdiParent = this;
                        frm.Show();
                        frm.RunDownload();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.ToString());
                    }
                }
            }
            catch (Exception)
            {
            }
        }
예제 #2
0
 private void barButtonItemProcessAll_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     for (int i = 0; i < maxthread; i++)
     {
         try
         {
             frmReDownloadImage frm = new frmReDownloadImage();
             frm.MdiParent = this;
             frm.Show();
             frm.RunDownload();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.ToString());
         }
     }
 }