private static void CalculatePackageDiskspaceAsync(object objPrms) { ThreadStartParameters prms = (ThreadStartParameters)objPrms; // impersonate thread SecurityContext.SetThreadPrincipal(prms.UserId); int packageId = (int)prms.Parameters[0]; try { // calculate CalculatePackagesDiskspaceTask calc = new CalculatePackagesDiskspaceTask(); calc.CalculatePackage(packageId); } catch (Exception ex) { // write to audit log TaskManager.WriteError(ex); } }
private static void CalculatePackageDiskspaceAsync(object objPrms) { ThreadStartParameters prms = (ThreadStartParameters)objPrms; // impersonate thread SecurityContext.SetThreadPrincipal(prms.UserId); int packageId = (int)prms.Parameters[0]; try { // calculate CalculatePackagesDiskspaceTask calc = new CalculatePackagesDiskspaceTask(); calc.CalculatePackage(packageId); } catch (Exception ex) { // write to audit log TaskManager.WriteError(ex); } }