Hellzbellz123

main cs

Jun 1st, 2019
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8.  
  9. namespace AddonUpdater
  10. {
  11. public class MakeUseableLink
  12. {
  13. public static string workingDirectory = Directory.GetCurrentDirectory();
  14. public static string downloadDirectory = workingDirectory + "/downloaded";
  15. public static string linkContainer = workingDirectory + "/link.txt";
  16. public static bool linkExists = File.Exists(linkContainer);
  17. public static MainWindow window = new MainWindow();
  18. public static string downloadLink, workingLinkInTextFile = null;
  19. public static List<string> linkList = File.ReadAllLines(linkContainer).ToList();
  20. public static string workingLink = null;
  21. public static bool done;
  22.  
  23. public static void FileCheck()
  24. {
  25. if (linkExists == true)
  26. {
  27. new Thread(FormatLinks).Start();
  28. }
  29. else
  30. {
  31. File.Create(linkContainer);
  32. window.MessageBoxNoLinks();
  33. }
  34. }
  35.  
  36. public static void FormatLinks()
  37. {
  38. string curseProject = "https://wow.curseforge.com/projects/";
  39. string curseForge = "https://mods.curse.com/addons/wow/";
  40. string wowAce = "https://www.wowace.com/projects/";
  41. string wowInterface = "http://www.wowinterface.com/";
  42.  
  43. foreach (var line in linkList)
  44. {
  45. workingLink = line;
  46. Console.WriteLine(workingLink);
  47. //DownloadStuffs();
  48. }
  49. }
  50.  
  51. public static void DownloadStuffs()
  52. {
  53. int WaitTime = 1000;
  54.  
  55. if (done != true)
  56. {
  57. Console.WriteLine("doing stuff with" + " " + workingLink);
  58. Console.WriteLine("waiting " + WaitTime + " milliseconds");
  59. Thread.Sleep(WaitTime);
  60. Console.WriteLine("");
  61. Console.WriteLine(done);
  62. }
  63. if (done == true)
  64. {
  65. Console.WriteLine("DONE");
  66. }
  67.  
  68. }
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment