Exemple #1
0
        public Form1()
        {
            AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
            Config = new Config420(this);
            CheckUpdate();
            AppDomain.CurrentDomain.ProcessExit += OnProcessExit;// Si on ferme le serveur on appel la fonction
            ThreadManager.StartServerThread(this);
            Reader.Init(this);
            Downloader     = new DownloaderMain(this);
            Debug.Elapsed += (o, b) =>
            {
                Mem.EmptyWorkingSetFunction();
                Mem.ClearFileSystemCache(false);
                GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce;
                GC.Collect();
            };
            Debug.Start();
            InitializeComponent();
            List <Object> ListObject = new List <object>();

            foreach (GameMetaInfo info in Downloader.AllGameMeta.GameList.Values)
            {
                ListObject.Add(info.Label);
            }
            StepBarGUI       = StepBar;
            DownloadBarGUI   = DownloadBar;
            TextBoxGUI       = TextBox;
            DownloadButtonUI = DownloadButton;
            ListGame.Items.AddRange(ListObject.ToArray());
        }
Exemple #2
0
        public void start()
        {
            Config = new Config420(this);
            Config.SaveConfig();
            LogManage = new LoggerManager(this);
            ThreadManager.StartServerThread(this);
            Reader.Init(this);
            Debug.Elapsed += cleanup;
            Debug.Start();
            AppDomain.CurrentDomain.ProcessExit += OnProcessExit;// Si on ferme le serveur on appel la fonction
            Console.CancelKeyPress += OnProcessExit;
            while (!Stopped)
            {
                Log("Enter The Folder Name To Scan or Exit:");
                string read = Console.ReadLine();
                switch (read)
                {
                case "Exit":
                    Log("Process kill");
                    ThreadManager.Stopped = true;
                    ThreadManager.WaitForEnd();
                    LogManage.Stop = true;
                    Stopped        = true;
                    break;

                default:
                    Log("Start Reading Folder");
                    Reader.AllFileToCheckCount(@".\" + read);
                    Mem.EmptyWorkingSetFunction();
                    Mem.ClearFileSystemCache(false);
                    Reader.SaveConfig(read);
                    break;
                }
            }
        }