Beispiel #1
0
        public void Remove()
        {
            if (downloadFile != null && state == StateType.Queue)
            {
                downloadFile.AsyncRemove();
            }

            if (!isRemove)
            {
                DownloadManager.Install.OnRemove(this);
                isRemove = true;
            }
            else
            {
                if (DownloadManager.Install.GetQueueNum(localPath) <= 0)
                {
                    for (int i = 0; i < DownloadFile.ProcessorCount; i++)
                    {
                        string tmp = DownloadUtil.GetTmpPath(localPath, i);
                        if (File.Exists(tmp))
                        {
                            File.Delete(tmp);
                        }
                    }
                }
                DownloadManager.Install.OnDelete(this);
            }

            state = StateType.None;
        }
Beispiel #2
0
 public void OnClickOpen()
 {
     if (fileInfo != null)
     {
         if (File.Exists(fileInfo.localPath))
         {
             RevealInFinder(fileInfo.localPath);
         }
         else if (File.Exists(DownloadUtil.GetTmpPath(fileInfo.localPath, 0)))
         {
             RevealInFinder(DownloadUtil.GetTmpPath(fileInfo.localPath, 0));
         }
         else
         {
             RevealInFinder(Path.GetDirectoryName(fileInfo.localPath));
         }
     }
 }