本文整理匯總了C#中System.Deployment.Application.ApplicationDeployment.IsFileGroupDownloaded方法的典型用法代碼示例。如果您正苦於以下問題:C# ApplicationDeployment.IsFileGroupDownloaded方法的具體用法?C# ApplicationDeployment.IsFileGroupDownloaded怎麽用?C# ApplicationDeployment.IsFileGroupDownloaded使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Deployment.Application.ApplicationDeployment
的用法示例。
在下文中一共展示了ApplicationDeployment.IsFileGroupDownloaded方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DownloadFileGroupAsync
private void DownloadFileGroupAsync(string fileGroup)
{
if (ApplicationDeployment.IsNetworkDeployed)
{
ApplicationDeployment deployment = ApplicationDeployment.CurrentDeployment;
try
{
if (!deployment.IsFileGroupDownloaded(fileGroup))
{
deployment.DownloadFileGroupProgressChanged += new DeploymentProgressChangedEventHandler(deployment_DownloadFileGroupProgressChanged);
deployment.DownloadFileGroupCompleted += new DownloadFileGroupCompletedEventHandler(deployment_DownloadFileGroupCompleted);
deployment.DownloadFileGroupAsync(fileGroup);
}
}
catch (InvalidOperationException ioe)
{
MessageBox.Show("This application is not a ClickOnce application. Error: " + ioe.Message);
return;
}
}
}
void deployment_DownloadFileGroupProgressChanged(object sender, DeploymentProgressChangedEventArgs e)
{
downloadStatus.Text = String.Format("Downloading file group {0}; {1:D}K of {2:D}K completed.", e.Group, e.BytesCompleted / 1024, e.BytesTotal / 1024);
}
void deployment_DownloadFileGroupCompleted(object sender, DownloadFileGroupCompletedEventArgs e)
{
if (e.Error != null)
{
downloadStatus.Text = "Could not download files. Will try again later.";
return;
}
else if (e.Cancelled)
{
downloadStatus.Text = "The file download has been cancelled.";
return;
}
downloadStatus.Text = String.Format("Download of file group {0} complete.", e.Group);
}
開發者ID:.NET開發者,項目名稱:System.Deployment.Application,代碼行數:44,代碼來源:ApplicationDeployment.IsFileGroupDownloaded