Пример #1
0
    /// <summary>
    /// Additional Download method used for downloading pictures and closeups (Uses EventHandlers).
    /// </summary>
    /// <param name="url">URL of the website containing the file.</param>
    /// <param name="filename">Full path with filename and extension.</param>
    /// <param name="picture"><see cref="GameTextureManager.PictureResource"/> required for EventHandler.</param>
    public bool Download(string url, string filename, GameTextureManager.PictureResource picture, bool forCloseup)
    {
        var flag = Download(url, filename);

        if (filename.Contains("closeup"))
        {
            EventHandler handler = DownloadCloseupCompleted;
            if (handler != null)
            {
                handler(this, new DownloadPicCompletedEventArgs(picture, flag, filename));
            }
        }
        if (filename.Contains("card") && forCloseup)
        {
            EventHandler handler = DownloadForCloseUpCompleted;
            if (handler != null)
            {
                handler(this, new DownloadPicCompletedEventArgs(picture, flag, filename));
            }
        }
        else if (filename.Contains("card"))
        {
            EventHandler handler = DownloadCardCompleted;
            if (handler != null)
            {
                handler(this, new DownloadPicCompletedEventArgs(picture, flag, filename));
            }
        }
        return(flag);
    }
Пример #2
0
 public DownloadPicCompletedEventArgs(GameTextureManager.PictureResource pic, bool downloadSuccesful, string filename)
 {
     Pic = pic;
     DownloadSuccesful = downloadSuccesful;
     Filename          = filename;
 }