/// <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; } }
/// <summary> /// 设置下载完成后的操作 /// </summary> /// <param name="afterDownload"></param> /// <returns></returns> public bool SetAfterDownloadOperation(AfterDownloadOperation afterDownload) { appSettings.Basic.AfterDownload = afterDownload; return(SetSettings()); }
/// <summary> /// 设置下载完成后的操作 /// </summary> /// <param name="afterDownload"></param> /// <returns></returns> public bool SetAfterDownloadOperation(AfterDownloadOperation afterDownload) { settingsEntity.AfterDownload = afterDownload; return(SetEntity()); }