コード例 #1
0
    /// <summary>
    /// Displays the information of the downloadable item
    /// </summary>
    /// <param name="download"></param>
    private void DisplayDownloadInfo(DownloadableItem download)
    {
        if (null != download)
        {
            lblDownloadIdCaption.Text = string.Format("Download Id : {0}", download.DownloadId);
            if (CommonLogic.FileExists(string.Format("images/icon/{0}.png", download.Extension)))
            {
                imgFileType.ImageUrl = string.Format("images/icon/{0}.png", download.Extension);
            }
            else
            {
                imgFileType.ImageUrl = "images/icon/defaultfile.png";
            }

            lblFileNameCaption.Text = string.Format("File Name: {0}", download.FileName);
            lblContentType.Text     = string.Format("Content Type: {0}", download.ContentType);
            lblDownloadCaption.Text = string.Format("This file has been downloaded {0} times", download.GetNumberOfDownloads());
            lblDownloadSize.Text    = string.Format("File size: {0} kb", download.ContentLength);
            if (download.IsPhysicalFileExisting())
            {
                lblActiveCaption.Text = string.Format("This file is {0}", download.IsActive ? "active" : "inactive");
            }
            else
            {
                lblActiveCaption.Text = "This file is missing!!!";
            }

            pnlInfo.Visible = true;
        }
        else
        {
            pnlInfo.Visible = false;
        }
    }
コード例 #2
0
    /// <summary>
    /// Displays the information of the downloadable item
    /// </summary>
    /// <param name="download"></param>
    private void DisplayDownloadInfo(DownloadableItem download)
    {
        if (null != download)
        {
            lblDownloadIdCaption.Text = string.Format("Download Id : {0}", download.DownloadId);
            lblFileNameCaption.Text   = string.Format("File Name: {0}", download.FileName);
            lblContentType.Text       = string.Format("Content Type: {0}", download.ContentType);
            lblDownloadCaption.Text   = string.Format("This file has been downloaded {0} times", download.GetNumberOfDownloads());
            lblDownloadSize.Text      = string.Format("File size: {0} kb", download.ContentLength);
            lblActiveCaption.Text     = string.Format("This file is {0}", download.IsActive ? "active" : "inactive");

            pnlInfo.Visible = true;
        }
        else
        {
            pnlInfo.Visible = false;
        }
    }