Guest User

Untitled

a guest
Jan 16th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. private readonly Dictionary<string, BlockingCollection<ProductModel>> _cache;
  2.  
  3. for (var i = 0; i < _numberOfInstancesPerCollection; i++)
  4. {
  5. //this collection is the TValue of the _cache
  6. productModelCollection.Add(new ProductModel(name, version, ProductModel.CreateFromVT(....)));
  7. }
  8.  
  9. for (var i = 0; i < _numberOfInstancesPerCollection; i++)
  10. {
  11. //instance folder creation
  12. string instanceFolder = string.Format(.... i + 1);
  13. Directory.CreateDirectory(instanceFolder);
  14.  
  15. //package resource files is created on disk
  16. foreach (Package package in packageList)
  17. {
  18. string localFilePathPerInstance = string.Format("{0}\{1}", instanceFolder, package.Filename);
  19. File.WriteAllBytes(localFilePathPerInstance, package.Data);
  20. }
  21.  
  22. //create a product model from the actual package filename and add it to the cached collection
  23. productModelCollection.Add(new ProductModel(...., ProductModel.CreateFromVT(...., instanceFolder, vtzPackage.Filename)));
  24. }
  25.  
  26. //instance folder creation
  27. string instanceFolder = string.Format(....);
  28. Directory.CreateDirectory(instanceFolder);
  29.  
  30. //package resource files is created on disk
  31. foreach (Package package in packageList)
  32. {
  33. string localFilePathPerInstance = string.Format("{0}\{1}", instanceFolder, package.Filename);
  34. File.WriteAllBytes(localFilePathPerInstance, package.Data);
  35. }
  36.  
  37. for (var i = 0; i < _numberOfInstancesPerCollection; i++)
  38. {
  39. //create a product model from the actual package filename and add it to the cached collection
  40. productModelCollection.Add(new ProductModel(...., ProductModel.CreateFromVT(...., instanceFolder, vtzPackage.Filename)));
  41. }
Add Comment
Please, Sign In to add comment