示例#1
0
        /// <summary>
        /// 下载完成后的操作
        /// </summary>
        protected void AfterDownload()
        {
            AfterDownloadOperation operation = SettingsManager.GetInstance().GetAfterDownloadOperation();

            switch (operation)
            {
            case AfterDownloadOperation.NONE:
                // 没有操作
                break;

            case AfterDownloadOperation.OPEN_FOLDER:
                // 打开文件夹
                break;

            case AfterDownloadOperation.CLOSE_APP:
                // 关闭程序
                App.PropertyChangeAsync(() =>
                {
                    System.Windows.Application.Current.Shutdown();
                });
                break;

            case AfterDownloadOperation.CLOSE_SYSTEM:
                // 关机
                System.Diagnostics.Process.Start("shutdown.exe", "-s");
                break;

            default:
                break;
            }
        }
示例#2
0
 /// <summary>
 /// 设置下载完成后的操作
 /// </summary>
 /// <param name="afterDownload"></param>
 /// <returns></returns>
 public bool SetAfterDownloadOperation(AfterDownloadOperation afterDownload)
 {
     appSettings.Basic.AfterDownload = afterDownload;
     return(SetSettings());
 }
示例#3
0
 /// <summary>
 /// 设置下载完成后的操作
 /// </summary>
 /// <param name="afterDownload"></param>
 /// <returns></returns>
 public bool SetAfterDownloadOperation(AfterDownloadOperation afterDownload)
 {
     settingsEntity.AfterDownload = afterDownload;
     return(SetEntity());
 }